From 00cd31a1d41d0580b2f9ac765badb234e0643ea2 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 30 Jan 2022 03:12:47 -0500 Subject: autoconf-wrapper: simplify known version list Since the 2.1/2.5 version aliases are inlined in the WANT_AUTOCONF parse logic now, there's no need to keep annotating every specific version with it. Drop it to simplify the logic a bit. Signed-off-by: Mike Frysinger --- ac-wrapper.sh | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/ac-wrapper.sh b/ac-wrapper.sh index 57324bb..bd9a8d9 100755 --- a/ac-wrapper.sh +++ b/ac-wrapper.sh @@ -78,14 +78,13 @@ fi # Set up bindings between actual version and WANT_AUTOCONF; # Start at last known unstable/stable versions to speed up lookup process. # -KNOWN_AUTOCONF="2.71:2.5 2.70:2.5 2.69:2.5" -vers="${KNOWN_AUTOCONF} 9999:2.5 $(printf '2.%s:2.5 ' `seq 99 -1 59`) 2.13:2.1" +KNOWN_AUTOCONF="2.71 2.70 2.69" +vers="${KNOWN_AUTOCONF} 9999 $(printf '2.%s ' `seq 99 -1 59`) 2.13" binary="" for v in ${vers} ; do - auto_ver=${v%:*} - if [ -z "${binary}" ] && [ -x "${full_argv0}-${auto_ver}" ] ; then - binary="${full_argv0}-${auto_ver}" + if [ -z "${binary}" ] && [ -x "${full_argv0}-${v}" ] ; then + binary="${full_argv0}-${v}" break fi done @@ -107,7 +106,6 @@ if [ -n "${WANT_AUTOCONF}" ] ; then break fi - auto_ver=${v%:*} for wx in ${WANT_AUTOCONF} ; do if [ "${wx}" = "latest" ] ; then wx="2.5" @@ -119,12 +117,12 @@ if [ -n "${WANT_AUTOCONF}" ] ; then v="x" break elif [ "${wx}" = "2.5" ] ; then - if [ "${auto_ver}" = "2.13" ] ; then + if [ "${v}" = "2.13" ] ; then # The "2.5" alias accepts every version except 2.13. continue fi - if [ -x "${full_argv0}-${auto_ver}" ] ; then - binary="${full_argv0}-${auto_ver}" + if [ -x "${full_argv0}-${v}" ] ; then + binary="${full_argv0}-${v}" v="x" break fi @@ -191,9 +189,8 @@ fi # if [ -z "${WANT_AUTOCONF}" ] ; then for v in ${vers} ; do - auto_ver=${v%:*} - if [ "${binary}" = "${full_argv0}-${auto_ver}" ] ; then - export WANT_AUTOCONF="${auto_ver}" + if [ "${binary}" = "${full_argv0}-${v}" ] ; then + export WANT_AUTOCONF="${v}" break fi done -- cgit v1.2.3-65-gdbad