summaryrefslogtreecommitdiff
path: root/acme2certifier/PKGBUILD
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2020-06-10 07:39:27 +0200
committerErich Eckner <git@eckner.net>2020-06-10 07:39:27 +0200
commit977da53c5870eb72bfdf63beda5601ec3b4978c3 (patch)
tree2fd7845a38f6b067c5a856fac41b48d3863fce0c /acme2certifier/PKGBUILD
parent94c0c68f0d67fb9d250520408022452da0c2c232 (diff)
downloadarchlinuxewe.git.save-977da53c5870eb72bfdf63beda5601ec3b4978c3.tar.xz
acme2certifier: pkgver(): track *really* first appearance of version line in acme/version.py
Diffstat (limited to 'acme2certifier/PKGBUILD')
-rw-r--r--acme2certifier/PKGBUILD28
1 files changed, 19 insertions, 9 deletions
diff --git a/acme2certifier/PKGBUILD b/acme2certifier/PKGBUILD
index be5e7b30..06a54f34 100644
--- a/acme2certifier/PKGBUILD
+++ b/acme2certifier/PKGBUILD
@@ -35,16 +35,26 @@ pkgver() {
git -C "${pkgname}" rev-parse "${_trial}" 2>/dev/null
) && break
done
- _version_line=$(
- git -C "${pkgname}" archive ${_commit} -- acme/version.py \
+
+ _line_revision="${_commit}"
+ while true; do
+ _version_line=$(
+ git -C "${pkgname}" archive "${_line_revision}" -- acme/version.py \
+ | tar -Ox \
+ | grep -n '^__version__\s*='
+ )
+ _line="${_version_line%%:*}"
+ _line_revision=$(
+ git -C "${pkgname}" blame -L"${_line},${_line}" "${_line_revision}" -- acme/version.py \
+ | awk '{print $1}'
+ )
+ if ! git -C "${pkgname}" archive "${_line_revision}^" -- acme/version.py \
| tar -Ox \
- | grep -n '^__version__\s*='
- )
- _line="${_version_line%%:*}"
- _line_revision=$(
- git -C "${pkgname}" blame -L"${_line},${_line}" "${_commit}" -- acme/version.py \
- | awk '{print $1}'
- )
+ | grep -qxF "${_version_line#*:}"; then
+ break
+ fi
+ _line_revision="${_line_revision}^"
+ done
_version="${_version_line%\'*}"
_version="${_version##*\'}"
_version="${_version%-*}"