From b7f27f44b719d50f91cee28570d70a2eb23cd833 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Thu, 23 Jan 2025 21:39:35 +0100 Subject: [PATCH] bootstrap: Make it work with module 'package-version'. Reported by Basil L. Contovounesios in . * top/bootstrap-funclib.sh (normalize_package_name): New variable. (extract_package_name): Don't normalize the package name here. (package): Also look at the first argument of a gl_INIT_PACKAGE invocation. * build-aux/bootstrap: Regenerated. --- ChangeLog | 11 +++++++++++ build-aux/bootstrap | 25 +++++++++++++++++-------- top/bootstrap-funclib.sh | 25 +++++++++++++++++-------- 3 files changed, 45 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index e5419275d4..8c6b369348 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2025-01-23 Bruno Haible + + bootstrap: Make it work with module 'package-version'. + Reported by Basil L. Contovounesios in + . + * top/bootstrap-funclib.sh (normalize_package_name): New variable. + (extract_package_name): Don't normalize the package name here. + (package): Also look at the first argument of a gl_INIT_PACKAGE + invocation. + * build-aux/bootstrap: Regenerated. + 2025-01-22 Bruno Haible doc: Document the workflows of the .tarball-version and .version files. diff --git a/build-aux/bootstrap b/build-aux/bootstrap index f6a6214315..8e15db3bf3 100755 --- a/build-aux/bootstrap +++ b/build-aux/bootstrap @@ -37,7 +37,7 @@ medir=`dirname "$me"` # A library of shell functions for autopull.sh, autogen.sh, and bootstrap. -scriptlibversion=2025-01-09.08; # UTC +scriptlibversion=2025-01-23.20; # UTC # Copyright (C) 2003-2025 Free Software Foundation, Inc. # @@ -152,7 +152,8 @@ po_download_command_format=\ "wget --mirror --level=1 -nd -nv -A.po -P '%s' \ https://translationproject.org/latest/%s/" -# Prefer a non-empty tarname (4th argument of AC_INIT if given), else +# When extracting the package name from an AC_INIT invocation, +# prefer a non-empty tarname (4th argument of AC_INIT if given), else # fall back to the package name (1st argument with munging). extract_package_name=' /^AC_INIT(\[*/{ @@ -164,17 +165,25 @@ extract_package_name=' q } s/[],)].*// - s/^GNU // - y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ - s/[^abcdefghijklmnopqrstuvwxyz0123456789_]/-/g p } ' -package=$(${AUTOCONF:-autoconf} --trace AC_INIT:\$4 configure.ac 2>/dev/null) +normalize_package_name=' + s/^GNU // + y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ + s/[^abcdefghijklmnopqrstuvwxyz0123456789_]/-/g +' +package=$(${AUTOCONF:-autoconf} --trace 'gl_INIT_PACKAGE:$1' configure.ac \ + 2>/dev/null) if test -z "$package"; then - package=$(sed -n "$extract_package_name" configure.ac) \ - || die 'cannot find package name in configure.ac' + package=$(${AUTOCONF:-autoconf} --trace 'AC_INIT:$4' configure.ac \ + 2>/dev/null) + if test -z "$package"; then + package=$(sed -n "$extract_package_name" configure.ac) \ + || die 'cannot find package name in configure.ac' + fi fi +package=$(echo "$package" | sed "$normalize_package_name") gnulib_name=lib$package build_aux=build-aux diff --git a/top/bootstrap-funclib.sh b/top/bootstrap-funclib.sh index a48bd63bb2..1810a5c783 100644 --- a/top/bootstrap-funclib.sh +++ b/top/bootstrap-funclib.sh @@ -1,6 +1,6 @@ # A library of shell functions for autopull.sh, autogen.sh, and bootstrap. -scriptlibversion=2025-01-09.08; # UTC +scriptlibversion=2025-01-23.20; # UTC # Copyright (C) 2003-2025 Free Software Foundation, Inc. # @@ -115,7 +115,8 @@ po_download_command_format=\ "wget --mirror --level=1 -nd -nv -A.po -P '%s' \ https://translationproject.org/latest/%s/" -# Prefer a non-empty tarname (4th argument of AC_INIT if given), else +# When extracting the package name from an AC_INIT invocation, +# prefer a non-empty tarname (4th argument of AC_INIT if given), else # fall back to the package name (1st argument with munging). extract_package_name=' /^AC_INIT(\[*/{ @@ -127,17 +128,25 @@ extract_package_name=' q } s/[],)].*// - s/^GNU // - y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ - s/[^abcdefghijklmnopqrstuvwxyz0123456789_]/-/g p } ' -package=$(${AUTOCONF:-autoconf} --trace AC_INIT:\$4 configure.ac 2>/dev/null) +normalize_package_name=' + s/^GNU // + y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ + s/[^abcdefghijklmnopqrstuvwxyz0123456789_]/-/g +' +package=$(${AUTOCONF:-autoconf} --trace 'gl_INIT_PACKAGE:$1' configure.ac \ + 2>/dev/null) if test -z "$package"; then - package=$(sed -n "$extract_package_name" configure.ac) \ - || die 'cannot find package name in configure.ac' + package=$(${AUTOCONF:-autoconf} --trace 'AC_INIT:$4' configure.ac \ + 2>/dev/null) + if test -z "$package"; then + package=$(sed -n "$extract_package_name" configure.ac) \ + || die 'cannot find package name in configure.ac' + fi fi +package=$(echo "$package" | sed "$normalize_package_name") gnulib_name=lib$package build_aux=build-aux -- 2.39.5