Package Details: panrun-git r14.2e08db5-1

Git Clone URL: https://aur.archlinux.org/panrun-git.git (read-only, click to copy)
Package Base: panrun-git
Description: Script that looks at the YAML metadata in a markdown file and runs pandoc for you.
Upstream URL: https://github.com/mb21/panrun
Licenses: MIT
Submitter: milk
Maintainer: milk (gesh)
Last Packager: milk
Votes: 1
Popularity: 0.003167
First Submitted: 2020-08-03 16:27
Last Updated: 2020-08-03 16:27

Dependencies (3)

Required by (0)

Sources (1)

Latest Comments

gesh commented on 2021-01-13 21:31

Note: makepkg clones the repository to panrun, so pkgver,package fail. Also, instead of overcomplicating the version, can just tag the root commit. Below is a patch implementing this:

diff --git a/PKGBUILD b/PKGBUILD
index 697e070..840b11c 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,5 +1,6 @@
 pkgname=panrun-git
+_gitname="${pkgname%-git}"
 pkgver=r14.2e08db5
 pkgrel=1
 pkgdesc='Script that looks at the YAML metadata in a markdown file and runs pandoc for you.'
 arch=('i686' 'x86_64')
@@ -11,15 +12,13 @@ source=('git+https://github.com/mb21/panrun')
 md5sums=('SKIP')

 pkgver() {
-  cd "$pkgname"
-  ( set -o pipefail
-    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)"
-  )
+  cd "$_gitname"
+  git tag -f v0.0.0.0 $(git rev-list HEAD | tail -n 1)
+  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
 }

 package() {
-  cd "$pkgname"
+  cd "$_gitname"
   install -D -m775 panrun "$pkgdir/usr/bin/panrun"
   install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
 }