summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorXZS2016-02-16 12:25:20 +0100
committerXZS2016-02-16 12:25:20 +0100
commita1ce3a0cae55d8fc0336463ad75f6cea07c5aaac (patch)
treeac9902220ca58cca0c1a79dc2e0a8834c6bd3421
parente3c7f34d41aa657e58f10edba9c81549036cbb77 (diff)
downloadaur-a1ce3a0cae55d8fc0336463ad75f6cea07c5aaac.tar.gz
look for JSON descriptions in subdirectories
As the pkgver function even runs before prepare, it is not possible to move its contents down a directory level. Thus, the JSON description should be found also when still in a subdirectory at this point of time.
-rw-r--r--PKGBUILD5
1 files changed, 3 insertions, 2 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 21b6c4a75c1b..2b110073f2a8 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -43,8 +43,9 @@ query-version() {
pkgver() {
cd "$_gitname"
- sed -n 's/.*"version"\s*:\s*"\([[:digit:].]*\)"\s*,.*/\1/p' \
- *.json 2>/dev/null | tr '\n' '.'
+ find -iname '*.json' -exec sed -n \
+ 's/.*"version"\s*:\s*"\([[:digit:].]*\)"\s*,.*/\1/p' \
+ '{}' \; -quit 2>/dev/null | tr '\n' '.'
printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}