summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorYour Name2021-02-25 23:52:02 +0100
committerYour Name2021-02-25 23:52:02 +0100
commit7ecd6ff01d62628b207ec0ed5a4bc85fb36c6298 (patch)
treea70d4fa3d875547dce13b80d58621ef0ea9aae12
parentfc4381d1f6e11c5c1c2a8a311185f8b249b32b6a (diff)
downloadaur-7ecd6ff01d62628b207ec0ed5a4bc85fb36c6298.tar.gz
next iteration
-rw-r--r--PKGBUILD30
1 files changed, 30 insertions, 0 deletions
diff --git a/PKGBUILD b/PKGBUILD
index e1acad20dc86..7d10416e5914 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -90,6 +90,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+=(