summaryrefslogtreecommitdiff
path: root/dbmodel
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2018-03-25 14:05:34 +0200
committerErich Eckner <git@eckner.net>2018-03-25 14:05:34 +0200
commit72ea3ceb62c21039afb48099e2fc47e141afd98b (patch)
tree0e06737c809cf4a4003be7423d490409a1cb924d /dbmodel
parent8e63786061a6695c72a25bf61483b9dd776efafd (diff)
downloadarchlinuxewe-72ea3ceb62c21039afb48099e2fc47e141afd98b.tar.xz
dbmodel: improve pkgver()
Diffstat (limited to 'dbmodel')
-rwxr-xr-xdbmodel/PKGBUILD20
1 files changed, 19 insertions, 1 deletions
diff --git a/dbmodel/PKGBUILD b/dbmodel/PKGBUILD
index 1974ca748..516759d09 100755
--- a/dbmodel/PKGBUILD
+++ b/dbmodel/PKGBUILD
@@ -27,7 +27,25 @@ sha512sums=('SKIP'
pkgver(){
cd "${pkgname}"
- printf "%s.r%s" "${_pkgver}" "$(git rev-list --count ${_commit}).$(git rev-parse --short ${_commit})"
+ git fetch --all >/dev/null 2>&1
+ _commit=$(
+ git rev-parse origin/master
+ )
+ printf '%s.r%s.%s\n' \
+ "$(
+ git archive "${_commit}" -- 'src/src.pro' | \
+ sed -n '
+ s/^VERSION = //
+ T
+ p
+ '
+ )" \
+ "$(
+ git rev-list --count "${_commit}"
+ )" \
+ "$(
+ git rev-parse --short "${_commit}"
+ )"
}
prepare() {