From: Bruno Haible Date: Tue, 1 Jul 2025 14:50:52 +0000 (+0200) Subject: autopoint: Don't fail if no gettext version is specified, part 2. X-Git-Tag: v0.23.2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=877c911ad81ea90bdd8270a3fb4fc76d9a8a72a3;p=thirdparty%2Fgettext.git autopoint: Don't fail if no gettext version is specified, part 2. * gettext-tools/misc/autopoint.in (func_trace_sed): Recognize also macro calls without arguments. * gettext-tools/tests/autopoint-1: Update for new autopoint behaviour. --- diff --git a/gettext-tools/misc/autopoint.in b/gettext-tools/misc/autopoint.in index 97193ecb5..1ccc52a0e 100644 --- a/gettext-tools/misc/autopoint.in +++ b/gettext-tools/misc/autopoint.in @@ -159,11 +159,13 @@ m4_pushdef([m4_esyscmd]) # func_trace_sed macro configure.ac # traces an Autoconf macro call and outputs the arguments to stdout, -# using sed. +# using sed. For a macro call without arguments, print just a blank line. func_trace_sed () { sed_extract_arguments=' -s,#.*$,,; s,^dnl .*$,,; s, dnl .*$,,; +s,#.*$,, +s,^dnl .*$,, +s, dnl .*$,, /'"$1"'(/ { ta :a @@ -175,6 +177,8 @@ s,#.*$,,; s,^dnl .*$,,; s, dnl .*$,,; :b s,^.*'"$1"'([[ ]*\([^]"$`\\)]*\).*$,\1,p } +/'"$1"'[^A-Za-z0-9_(]/ s,^.*$,,p +/'"$1"'$/ s,^.*$,,p d' sed -e "$sed_extract_arguments" "$2" } diff --git a/gettext-tools/tests/autopoint-1 b/gettext-tools/tests/autopoint-1 index 4ad48e112..19b01c530 100755 --- a/gettext-tools/tests/autopoint-1 +++ b/gettext-tools/tests/autopoint-1 @@ -40,32 +40,12 @@ AC_CONFIG_FILES([Makefile]) AC_OUTPUT EOF -$gettext_datadir/autopoint 2>&1 | grep 'Missing version' 2>&1 >/dev/null \ - || Exit 1 +$gettext_datadir/autopoint || Exit 1 test ! -d intl || Exit 1 -test ! -d m4 || Exit 1 -test ! -d po || Exit 1 - -# VERSION specified through intl/VERSION file, but in wrong format -cat <<\EOF >configure.ac -AC_INIT -AC_CONFIG_SRCDIR(hello.c) - -AC_PROG_CC - -AC_CONFIG_FILES([Makefile]) -AC_OUTPUT -EOF - -test -d intl || mkdir intl -echo bogus-version > intl/VERSION - -$gettext_datadir/autopoint 2>&1 | grep 'Missing version' 2>&1 >/dev/null \ - || Exit 1 - -test ! -d m4 || Exit 1 -test ! -d po || Exit 1 +test -d m4 || Exit 1 +test -d po || Exit 1 +rm -rf ABOUT-NLS config.rpath m4 po # VERSION specified through intl/VERSION file cat <<\EOF >configure.ac @@ -73,6 +53,7 @@ AC_INIT AC_CONFIG_SRCDIR(hello.c) AC_PROG_CC +AM_GNU_GETTEXT AC_CONFIG_FILES([Makefile]) AC_OUTPUT