From 542b6fce139047b5a0fa42ae11179a2308ac8f9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingo=20Kl=C3=B6cker?= Date: Fri, 21 Feb 2025 11:12:49 +0100 Subject: Fix logic for finding the beta version number MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * autogen.sh: Check if $tmp is empty after each assignment. -- This fixes the problem that due to the gpg4win-5.0.0-beta103 tag `./autogen.sh --find-version gpg4win 5 0 0` erroneously outputs version 5.0.0 instead of 5.0.0-betaNNN. Fix originally done for gpg4win and copied to gpgrt by wk@gnupg.org: commit d3452493e665a4175218b7272ca8b1ca6fc57718 Author: Ingo Klöcker AuthorDate: Wed Feb 19 15:46:55 2025 +0100 --- autogen.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/autogen.sh b/autogen.sh index 0b08e8b..a2c469f 100755 --- a/autogen.sh +++ b/autogen.sh @@ -15,7 +15,7 @@ # configure it for the respective package. It is maintained as part of # GnuPG and source copied by other packages. # -# Version: 2024-12-03 +# Version: 2025-02-21 configure_ac="configure.ac" @@ -264,13 +264,15 @@ if [ "$myhost" = "find-version" ]; then if [ -n "$tmp" ]; then tmp=$(echo "$tmp" | sed s/^"$package"// \ | awk -F- '$3!=0 && $3 !~ /^beta/ {print"-beta"$3}') - else + fi + if [ -z "$tmp" ]; then # (due tof "-base" in the tag we need to take the 4th field) tmp=$(git describe --match "${matchstr2}" --long 2>/dev/null) if [ -n "$tmp" ]; then tmp=$(echo "$tmp" | sed s/^"$package"// \ | awk -F- '$4!=0 && $4 !~ /^beta/ {print"-beta"$4}') - elif [ -n "${matchstr3}" ]; then + fi + if [ -z "$tmp" -a -n "${matchstr3}" ]; then tmp=$(git describe --match "${matchstr3}" --long 2>/dev/null) if [ -n "$tmp" ]; then tmp=$(echo "$tmp" | sed s/^"$package"// \ -- cgit v1.2.3