summaryrefslogtreecommitdiff
path: root/dbmodel/PKGBUILD
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/PKGBUILD
parent8e63786061a6695c72a25bf61483b9dd776efafd (diff)
downloadarchlinuxewe.git.save-72ea3ceb62c21039afb48099e2fc47e141afd98b.tar.xz
dbmodel: improve pkgver()
Diffstat (limited to 'dbmodel/PKGBUILD')
-rwxr-xr-xdbmodel/PKGBUILD20
1 files changed, 19 insertions, 1 deletions
diff --git a/dbmodel/PKGBUILD b/dbmodel/PKGBUILD
index 1974ca74..516759d0 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() {