diff options
author | Pascal Mehnert | 2020-06-14 16:46:12 +0200 |
---|---|---|
committer | Pascal Mehnert | 2020-06-14 16:46:12 +0200 |
commit | 12fda3aa9ac7d94a12f85a6cb1fb306c714bb3e1 (patch) | |
tree | aa018a296738ccafeef6f5f17ae0e7429932ba2f | |
parent | db8e71dcabb436689ad930c0e296691950397f4e (diff) | |
download | aur-12fda3aa9ac7d94a12f85a6cb1fb306c714bb3e1.tar.gz |
Improve pkgver function with better sed command
-rw-r--r-- | PKGBUILD | 19 |
1 files changed, 4 insertions, 15 deletions
@@ -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" } |