add .0 to version when necessary to sort better

master
yar 2017-04-12 14:42:49 -07:00
parent 0a4f9a787f
commit 7be1c2118d
No known key found for this signature in database
GPG Key ID: 3EA83F013020A074
2 changed files with 13 additions and 4 deletions

View File

@ -1,5 +1,5 @@
# Generated by mksrcinfo v8
# Thu Apr 6 19:33:46 UTC 2017
# Wed Apr 12 21:36:13 UTC 2017
pkgbase = alpine-git
pkgdesc = Fork of the PINE mail client (git)
pkgver = 2.21.1.209.a9d7a00

View File

@ -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}"