summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Nixon2017-01-24 10:26:22 +0000
committerChris Nixon2017-01-24 10:26:22 +0000
commita1df140bdb93ae4df9abf3bce59b6f58a13b992c (patch)
tree01f907aaf253e7406d507e561daa839e9192026d
parent58db22b8c05b378f1ce029463b12779cfb1c951f (diff)
downloadaur-a1df140bdb93ae4df9abf3bce59b6f58a13b992c.tar.gz
Properly fix versioning (all credit to mrkline)
-rw-r--r--.SRCINFO2
-rw-r--r--PKGBUILD10
2 files changed, 5 insertions, 7 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 7859dc7507e3..24f58d4e4271 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = ripgrep-git
pkgdesc = A search tool that combines the usability of The Silver Searcher with the raw speed of grep.
- pkgver = 0.4.0.0.r057ed63
+ pkgver = 0.4.0.r12.b678862
pkgrel = 1
url = https://github.com/BurntSushi/ripgrep
arch = i686
diff --git a/PKGBUILD b/PKGBUILD
index e02930160956..1f593d1d028a 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,6 +1,6 @@
# Maintainer: Chris Nixon <chris.nixon@sigma.me.uk>
pkgname=ripgrep-git
-pkgver=0.4.0.0.r057ed63
+pkgver=0.4.0.r12.b678862
pkgrel=1
pkgdesc="A search tool that combines the usability of The Silver Searcher with the raw speed of grep."
arch=('i686' 'x86_64')
@@ -27,15 +27,13 @@ build() {
pkgver() {
cd "$pkgname"
- # Get the first part of the latest tag and append the current revision
- local tag=$(git tag | grep -v "^[a-zA-Z]" | tail -n1)
- echo "$(git describe --long $tag | sed 's/^\(.*\)-.*.*/\1/;s/-/./g').r$(git log --pretty=format:'%h' -n 1 $tag)"
+ local tag=$(git tag --sort=-v:refname | grep '^[0-9]' | head -1)
+ local commits_since=$(git rev-list $tag..HEAD --count)
+ echo "$tag.r$commits_since.$(git log --pretty=format:'%h' -n 1)"
}
package() {
cd "$pkgname"
- git checkout "$(git tag | grep -v "^[a-zA-Z]" | tail -n1)"
-
install -Dm755 "target/release/rg" "$pkgdir/usr/bin/rg"
install -Dm644 "doc/rg.1" "$pkgdir/usr/share/man/man1/rg.1"
install -Dm644 "README.md" "$pkgdir/usr/share/doc/ripgrep/README.md"