diff options
author | Your Name | 2021-07-27 20:24:36 +0200 |
---|---|---|
committer | Your Name | 2021-07-27 20:24:36 +0200 |
commit | f0568a0cdc6d8264379a4982c8706ac12f07f7a0 (patch) | |
tree | cdead50f5254a44cdad8e0e6a80ab685601bb0c8 | |
parent | 628fe071c462bde49ec6a3477d92aba31c969bb5 (diff) | |
download | aur-f0568a0cdc6d8264379a4982c8706ac12f07f7a0.tar.gz |
next iteration
-rw-r--r-- | .SRCINFO | 1 | ||||
-rw-r--r-- | PKGBUILD | 84 | ||||
-rw-r--r-- | changelog | 6 |
3 files changed, 79 insertions, 12 deletions
@@ -61,4 +61,3 @@ pkgbase = kopano-core-git md5sums = SKIP pkgname = kopano-core-git - @@ -26,6 +26,12 @@ _tagPrefix="kopanocore-" # template start; name=base-scm; version=1; #_tagPrefix="" #_tagSuffix="" +#_remoteGit="" + +if [[ "${pkgname}" == *-latest ]] && [ ! -z "${_remoteGit}" ]; +then + pkgver=$(git ls-remote --refs --tags "${_remoteGit}" | sed 's|.*tags/\(.*\)$|\1|' | sort -u | grep -vE "(beta|alpha|test)" | tail -n 1) +fi _basePkgName="${pkgname//-git/}" if [[ "${pkgname}" == *-git ]]; @@ -69,13 +75,16 @@ pkgver() { else echo "${pkgver}" | sed "s|\(.*\)-git|1.r${_revision}|" fi +# elif [[ "${pkgname}" == *-latest ]]; +# then +# #_tagReleaseFormat="^[0-9]*(\.[0-9])*$" +# _lastRelease=$(git tag -l "${_tagPrefix}*" --sort=v:refname | grep -v "(alpha|beta|test)" | tail -n 1) +# echo "${_lastRelease}" | sed "s|${_tagPrefix}\(.*\)${_tagSuffix}|\1|" else - echo ${pkgver} + echo "${pkgver}" fi } -_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}" ]; @@ -83,28 +92,70 @@ _patchFromGit() { git clone --bare ${1} ${_patchDir} fi - _sourceBranchName="${_sourceBranch//#*=/}" + _branchName="${_sourceBranch//#*=/}" + _patchGIT="git --git-dir="${_patchDir}"" + # Patch From Specific Range if [ ! -z "${3}" ]; then - git --git-dir="${_patchDir}" format-patch "^${2}" "${3}" --stdout | git apply + + _sourceCommit=$($_patchGIT rev-parse --verify --quiet "${2}") + _targetCommit=$($_patchGIT rev-parse --verify --quiet "${3}") + if $_patchGIT format-patch "^${_sourceCommit}" "${_targetCommit}" --stdout | git apply -v ; + then + echo "Patch Applied From Commit Between ${2} to ${3}" + else + echo "Patch Failed." + exit 1 + fi # 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 ; + _sourceCommit=$($_patchGIT rev-parse --verify --quiet "${2}") + if $_patchGIT format-patch -1 "${_sourceCommit}" --stdout | git apply -v ; + then + echo "Patch Applied From Commit ${2}" + else + echo "Patch Failed." + exit 1 + fi + + # Patch From "*-latest-patch" Branch + elif [[ "${pkgname}" != *-git ]] \ + && _sourceCommit=$($_patchGIT rev-parse --verify --quiet "${_branchName}") \ + && _targetCommit=$($_patchGIT rev-parse --verify --quiet "${_branchName}-latest-patch") ; then - git --git-dir="${_patchDir}" format-patch "^${_sourceBranchName}" "${_sourceBranchName}-patch" --stdout | git apply + + if $_patchGIT format-patch "^${_sourceCommit}" "${_targetCommit}" --stdout | git apply -v ; + then + echo "Patch Applied From Branch ${_branchName}-latest-patch" + else + echo "Patch Failed." + exit 1 + fi + + # Patch From "master-latest-patch" Branch + elif _sourceCommit=$($_patchGIT rev-parse --verify --quiet "master") \ + && _targetCommit=$($_patchGIT rev-parse --verify --quiet "master-latest-patch") ; + then + + if $_patchGIT format-patch "^${_sourceCommit}" "${_targetCommit}" --stdout | git apply -v ; + then + echo "Patch Applied From Branch master-latest-patch" + else + echo "Patch Failed." + exit 1 + fi else - echo "No Patch Branch Found [${_sourceBranchName}-patch]" + echo "No Patch Branch Found" fi } + +_sourceBranch=$(if [[ "${pkgname}" == *-git ]]; then echo "#branch=master"; else echo "#tag=${_tagPrefix}${pkgver}${_tagSuffix}"; fi) # template end; source=( "${pkgname}::git+https://stash.kopano.io/scm/kc/kopanocore.git${_sourceBranch}" @@ -213,6 +264,17 @@ done prepare() { cd ${srcdir}/${pkgname} _patchFromGit https://github.com/pietmacom/kopano-core.git + return 0 + + case "${_sourceBranch}" in + ${_tagPrefix}10*) + ;& + ${_tagPrefix}11*) + _patchFromGit https://github.com/pietmacom/kopano-core.git master master-patch + ;; + *) + ;; + esac } # When using official VMIME diff --git a/changelog b/changelog index 85c84ba4c10b..a3c575ec8037 100644 --- a/changelog +++ b/changelog @@ -34,3 +34,9 @@ * patch from git * patch from git: cherryPick * patch from git: corrosponding branch + +[2021-03-03] +* patch v10*/v11* from master + +[2021-03-10] +* added patch fallbacks |