summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorYour Name2021-02-25 23:50:55 +0100
committerYour Name2021-02-25 23:50:55 +0100
commit8bb045c4306a280624704eea074320ffe1bc7dd6 (patch)
tree6c70b8f6bb7466526bab8863cd5f1add9ffa1386 /PKGBUILD
parent94ddccc76d654307f7d0284b944d73ec5607d46e (diff)
downloadaur-8bb045c4306a280624704eea074320ffe1bc7dd6.tar.gz
next iteration
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD30
1 files changed, 30 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
index e84cc6d2fdad..081443c3aaf8 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -89,6 +89,36 @@ pkgver() {
}
_sourceBranch=$(if [[ "${pkgname}" == *-git ]]; then echo "#branch=master"; else echo "#tag=${_tagPrefix}${pkgver}${_tagSuffix}"; fi)
+
+_patchFromGit() {
+ _patchDir="${srcdir}/$(basename $(pwd))-patch.git"
+ if [ ! -e "${_patchDir}" ];
+ then
+ git clone --bare ${1} ${_patchDir}
+ fi
+
+ _sourceBranchName="${_sourceBranch//#*=/}"
+ # Patch From Specific Range
+ if [ ! -z "${3}" ];
+ then
+ git --git-dir="${_patchDir}" format-patch "^${2}" "${3}" --stdout | git apply
+
+ # Patch From Specific Commit
+ elif [ ! -z "${2}" ];
+ then
+ git --git-dir="${_patchDir}" format-patch -1 "${2}" --stdout | git apply
+
+ # Patch From Dedicated Branch
+ elif git --git-dir="${_patchDir}" rev-parse --verify --quiet "${_sourceBranchName}" > /dev/null \
+ && git --git-dir="${_patchDir}" rev-parse --verify --quiet "${_sourceBranchName}-patch" > /dev/null ;
+ then
+ git --git-dir="${_patchDir}" format-patch "^${_sourceBranchName}" "${_sourceBranchName}-patch" --stdout | git apply
+
+ else
+ echo "No Patch Branch Found [${_sourceBranchName}-patch]"
+
+ fi
+}
# template end;
source+=(