summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--PKGBUILD5
1 files changed, 4 insertions, 1 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 97681e65c44..81092d233db 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -22,7 +22,10 @@ md5sums=('SKIP')
pkgver() {
cd ${srcdir}/${_gitname}
- echo "$(git log -1 --format="%cd" --date=short | tr -d '-').$(git rev-list --count HEAD).$(git log -1 --format="%h")"
+ ( set -o pipefail
+ git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' ||
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+ )
}
prepare() {