From 0f08f4aa8058985ea16a1bdf9f4d40a235e0f41a Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Mon, 10 Mar 2025 14:41:59 +0100 Subject: Re-fix logic for finding the beta version number -- This reverts commit 542b6fce139047b5a0fa42ae11179a2308ac8f9e. and uses the --exclude option instead. --- autogen.sh | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/autogen.sh b/autogen.sh index a2c469f..8695fcb 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: 2025-02-21 +# Version: 2025-03-10 configure_ac="configure.ac" @@ -256,24 +256,23 @@ if [ "$myhost" = "find-version" ]; then matchstr3="$package-$major-base" vers="$major.$minor.$micro" fi + matchexcl="--exclude $package-*beta*" beta=no if [ -e .git ]; then ingit=yes - tmp=$(git describe --match "${matchstr1}" --long 2>/dev/null) + tmp=$(git describe --match "${matchstr1}" $matchexcl --long 2>/dev/null) if [ -n "$tmp" ]; then tmp=$(echo "$tmp" | sed s/^"$package"// \ | awk -F- '$3!=0 && $3 !~ /^beta/ {print"-beta"$3}') - fi - if [ -z "$tmp" ]; then + else # (due tof "-base" in the tag we need to take the 4th field) - tmp=$(git describe --match "${matchstr2}" --long 2>/dev/null) + tmp=$(git describe --match "${matchstr2}" $matchexcl --long 2>/dev/null) if [ -n "$tmp" ]; then tmp=$(echo "$tmp" | sed s/^"$package"// \ | awk -F- '$4!=0 && $4 !~ /^beta/ {print"-beta"$4}') - fi - if [ -z "$tmp" -a -n "${matchstr3}" ]; then - tmp=$(git describe --match "${matchstr3}" --long 2>/dev/null) + elif [ -n "${matchstr3}" ]; then + tmp=$(git describe --match "${matchstr3}" $matchexcl --long 2>/dev/null) if [ -n "$tmp" ]; then tmp=$(echo "$tmp" | sed s/^"$package"// \ | awk -F- '$4!=0 && $4 !~ /^beta/ {print"-beta"$4}') -- cgit v1.2.3