Fix pkgver() function and use the one from Arch Wiki

This changes the pkgver() function to use exactly the version suggested
in the Arch Wiki:

  https://wiki.archlinux.org/index.php/VCS_package_guidelines#Git
This commit is contained in:
Adrian Perez de Castro 2018-02-21 18:30:27 +00:00
parent 1acb4e04ac
commit 41de202da7
No known key found for this signature in database
GPG Key ID: 91C559DBE4C9123B
2 changed files with 5 additions and 5 deletions

View File

@ -1,7 +1,7 @@
pkgbase = wlroots-git pkgbase = wlroots-git
pkgdesc = Modular Wayland compositor library pkgdesc = Modular Wayland compositor library
pkgver = r1924.2e7d8862 pkgver = r1924.2e7d886
pkgrel = 1 pkgrel = 2
url = https://github.com/swaywm/wlroots url = https://github.com/swaywm/wlroots
arch = x86_64 arch = x86_64
license = custom:MIT license = custom:MIT

View File

@ -1,7 +1,7 @@
# Maintainer: Adrian Perez de Castro <aperez@igalia.com> # Maintainer: Adrian Perez de Castro <aperez@igalia.com>
pkgname='wlroots-git' pkgname='wlroots-git'
pkgver=r1924.2e7d8862 pkgver=r1924.2e7d886
pkgrel=1 pkgrel=2
license=('custom:MIT') license=('custom:MIT')
pkgdesc='Modular Wayland compositor library' pkgdesc='Modular Wayland compositor library'
url='https://github.com/swaywm/wlroots' url='https://github.com/swaywm/wlroots'
@ -20,7 +20,7 @@ pkgver () {
cd "${pkgname}" cd "${pkgname}"
( (
set -o pipefail set -o pipefail
git describe --long 2>/dev/null | sed 's/\([^-]*-g\)/r\1/;s/-/./g' | sed 's/^version\.//' || 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)" printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
) )
} }