diff options
author | Erich Eckner <git@eckner.net> | 2020-06-10 07:39:27 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2020-06-10 07:39:27 +0200 |
commit | 977da53c5870eb72bfdf63beda5601ec3b4978c3 (patch) | |
tree | 2fd7845a38f6b067c5a856fac41b48d3863fce0c /acme2certifier | |
parent | 94c0c68f0d67fb9d250520408022452da0c2c232 (diff) | |
download | archlinuxewe-977da53c5870eb72bfdf63beda5601ec3b4978c3.tar.xz |
acme2certifier: pkgver(): track *really* first appearance of version line in acme/version.py
Diffstat (limited to 'acme2certifier')
-rw-r--r-- | acme2certifier/PKGBUILD | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/acme2certifier/PKGBUILD b/acme2certifier/PKGBUILD index be5e7b305..06a54f34b 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%-*}" |