summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorfrealgagu2018-04-03 17:30:25 -0500
committerfrealgagu2018-04-03 17:30:25 -0500
commit7ab397cea6c76c3b64466b59e152d80b1a57e60e (patch)
tree2cc5740b44358dc3ebe24ac09dc09a473b6f4a04
parentd66f389509a3b38edd5922bfacd3bb60a864bb29 (diff)
downloadaur-7ab397cea6c76c3b64466b59e152d80b1a57e60e.tar.gz
Changing pkgver method
-rw-r--r--PKGBUILD12
1 files changed, 8 insertions, 4 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 26af181af69..1b5f45bf83d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -16,17 +16,21 @@ source=("${pkgname%-git}::git+https://github.com/casey/${pkgname%-git}.git")
sha256sums=("SKIP")
pkgver() {
- cd "${pkgname%-git}"
- git describe --long --tags | sed 's/\([^-]*-\)g/r\1/;s/-/./g' | tr -d v
+ cd "${srcdir}/${pkgname%-git}"
+ (
+ set -o pipefail
+ git describe --long --tags 2> /dev/null | sed "s/^[a-Z\.\-]*//;s/\([^-]*-\)g/r\1/;s/-/./g" ||
+ printf "r%s.%s\n" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
+ )
}
build() {
- cd "${pkgname%-git}"
+ cd "${srcdir}/${pkgname%-git}"
cargo build --release
}
package() {
- cd "${pkgname%-git}"
+ cd "${srcdir}/${pkgname%-git}"
install -Dm755 "${srcdir}/${pkgname%-git}/target/release/${pkgname%-git}" "${pkgdir}/usr/bin/${pkgname%-git}"
install -Dm644 "${srcdir}/${pkgname%-git}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}