summarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authoryar2017-04-12 14:42:49 -0700
committeryar2017-04-12 14:42:49 -0700
commit7be1c2118dd7bc358514f16fe41be0debaf4485d (patch)
treec9dbfe628bf65aed84f68c0060d2c8f935d7b4a5 /PKGBUILD
parent0a4f9a787f5ed9e71433628f1ea147efe0aa0e16 (diff)
downloadaur-7be1c2118dd7bc358514f16fe41be0debaf4485d.tar.gz
add .0 to version when necessary to sort better
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD15
1 files changed, 12 insertions, 3 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 01db07f9c44..e5febda9630 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -22,9 +22,18 @@ source=("git+http://repo.or.cz/${gitname}.git")
sha512sums=('SKIP')
pkgver() {
- cd "${srcdir}/${gitname}"
- local ver="$(cat VERSION).$(git rev-list --count HEAD).$(git rev-parse --short HEAD)"
- printf "%s" "${ver//-/.}"
+ cd "${srcdir}/${gitname}"
+
+ # we recently went
+ # from 2.21.204.5117359
+ # to 2.21.1.209.a9d7a00
+ # which rightfully confused pacman's version ordering
+ # so let's add a .0 to versions with only one dot
+ local v=$(cat VERSION)
+ [[ "$v" =~ ^[^\.]+\.[^\.]+\..*$ ]] || v=$v.0
+
+ local ver="${v}.$(git rev-list --count HEAD).$(git rev-parse --short HEAD)"
+ printf "%s" "${ver//-/.}"
}
build() {
cd "${srcdir}/${gitname}"