Fix pkgver(): tag lagging behind the project version

Signed-off-by: Greyson Christoforo <grey@christoforo.net>
This commit is contained in:
bartus 2021-10-05 08:45:27 +02:00 committed by Greyson Christoforo
parent d14b44c302
commit e99052d2c7
2 changed files with 6 additions and 3 deletions

View file

@ -1,6 +1,6 @@
pkgbase = freecad-git
pkgdesc = A general purpose 3D CAD modeler - git checkout
pkgver = 0.19.r909.gc401e3efe3
pkgver = 0.20.0.r1693.g8bb582f23f
pkgrel = 1
epoch = 0
url = https://www.freecadweb.org/

View file

@ -1,7 +1,7 @@
# Maintainer: Grey Christoforo <first name at last name dot net>
pkgname=freecad-git
pkgver=0.19.r909.gc401e3efe3
pkgver=0.20.0.r1693.g8bb582f23f
pkgrel=1
epoch=0
pkgdesc='A general purpose 3D CAD modeler - git checkout'
@ -59,7 +59,10 @@ md5sums=('SKIP')
pkgver() {
cd FreeCAD
git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
read -d$'/n' -r major minor patch < <(grep -Po "set\(PACKAGE_VERSION_(MAJOR|MINOR|PATCH) \"\K[0-9]*" CMakeLists.txt) || true
count=$(git rev-list --count $(git tag --sort=-creatordate|head -1)..HEAD)
hash=$(git rev-parse --short HEAD)
printf "%d.%d.%d.r%d.g%s" "$major" "$minor" "$patch" "$count" "$hash"
}
prepare() {