summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Spiess-Knafl2016-05-03 00:50:07 +0200
committerPeter Spiess-Knafl2016-05-03 00:50:07 +0200
commit99d2f7c67e0467e8441d2cf6e3c77d08a80ca748 (patch)
tree6b58fcc5ee8fc4ba58a69928badaa8d80f7c5119
parent5094304c1faebc3244fa0215895ac0dc596e5cc4 (diff)
downloadaur-99d2f7c67e0467e8441d2cf6e3c77d08a80ca748.tar.gz
fix pkgver() function
-rw-r--r--PKGBUILD10
1 files changed, 6 insertions, 4 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 11c9efe5572..a700181ab2d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,8 +3,8 @@
# Contributor: Daniel Bomar <dbdaniel42@gmail.com>
pkgname=libjson-rpc-cpp-git
-pkgver=20160317
-pkgrel=2
+pkgver=0.6.0.r28.g4066b2b
+pkgrel=1
pkgdesc="C++ framework for json-rpc 1.0 and 2.0"
arch=('i686' 'x86_64')
depends=('argtable' 'curl' 'jsoncpp' 'libmicrohttpd')
@@ -20,9 +20,11 @@ install=libjson-rpc-cpp.install
pkgver() {
cd ${pkgname%-git}
- git log -1 --format="%cd" --date=short | sed "s|-||g"
+ ( set -o pipefail
+ git describe --long --tags 2>/dev/null | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g' ||
+ printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+ )
}
-
prepare() {
cd "${srcdir}"/${pkgname%-git}
}