summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorYour Name2021-07-27 20:25:26 +0200
committerYour Name2021-07-27 20:25:26 +0200
commit5d3b90c4a9a30c763ae728ad0a88e01c305b3c99 (patch)
tree849ac953c793881426a721be52a7e15f553a87b0
parent7d5d38aa3b06d77130a21e680077e1270f0295b5 (diff)
downloadaur-5d3b90c4a9a30c763ae728ad0a88e01c305b3c99.tar.gz
next iteration
-rw-r--r--.SRCINFO1
-rw-r--r--PKGBUILD73
2 files changed, 62 insertions, 12 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 81d83448e456..d32f939e448c 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -17,4 +17,3 @@ pkgbase = kopano-webapp-mdm-git
md5sums = 30bd89417f7089d30db62fb4c1f09996 kopano-webapp-mdm.ini
pkgname = kopano-webapp-mdm-git
-
diff --git a/PKGBUILD b/PKGBUILD
index 9cc95ac58382..73b2b6dd3ab8 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -40,6 +40,12 @@ done
# 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 ]];
@@ -83,13 +89,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}" ];
@@ -97,28 +106,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
+
+ 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
- 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 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+=(