summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Mehnert2020-06-14 16:46:12 +0200
committerPascal Mehnert2020-06-14 16:46:12 +0200
commit12fda3aa9ac7d94a12f85a6cb1fb306c714bb3e1 (patch)
treeaa018a296738ccafeef6f5f17ae0e7429932ba2f
parentdb8e71dcabb436689ad930c0e296691950397f4e (diff)
downloadaur-12fda3aa9ac7d94a12f85a6cb1fb306c714bb3e1.tar.gz
Improve pkgver function with better sed command
-rw-r--r--PKGBUILD19
1 files changed, 4 insertions, 15 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 89e4b443df94..0373ca32d525 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -15,24 +15,13 @@ source=('git+https://github.com/lucc/nvimpager.git')
sha256sums=('SKIP')
pkgver() {
- cd nvimpager/
-
- if GITTAG="$(git describe --abbrev=0 --tags 2>/dev/null)"; then
- printf '%s.r%s.g%s' \
- "$(sed -e "s/^${pkgname%%-git}//" -e 's/^[-_/a-zA-Z]\+//' -e 's/[-_+]/./g' <<< ${GITTAG})" \
- "$(git rev-list --count ${GITTAG}..)" \
- "$(git log -1 --format='%h')"
- else
- printf '0.r%s.g%s' \
- "$(git rev-list --count master)" \
- "$(git log -1 --format='%h')"
- fi
+ cd nvimpager/
+ git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g;s/^v//'
}
package() {
- cd nvimpager/
-
- make PREFIX="/usr" DESTDIR="${pkgdir}" install
+ cd nvimpager/
+ make PREFIX="/usr" DESTDIR="${pkgdir}" install
install -Dm644 LICENSE "$pkgdir/usr/share/licenses/vimpager/LICENSE"
}