diff options
author | Your Name | 2021-02-25 23:51:47 +0100 |
---|---|---|
committer | Your Name | 2021-02-25 23:51:47 +0100 |
commit | 0f5ef4d5ada87fbe230f8de6a5deb138cd3f563c (patch) | |
tree | 98f436e92921281d5b518bfda11b78b0e5b857f5 | |
parent | a9e75f27d582137146a9fc1143c2b67ea0e70716 (diff) | |
download | aur-0f5ef4d5ada87fbe230f8de6a5deb138cd3f563c.tar.gz |
next iteration
-rw-r--r-- | PKGBUILD | 30 |
1 files changed, 30 insertions, 0 deletions
@@ -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+=( |