From a071c8a3cdff4f6487390ceeb720cc9ae66e1474 Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Mon, 7 Jan 2013 08:09:09 +0900 Subject: [PATCH] Make autopoint AM_GNU_GETTEXT_VERSION handling more robust. --- gettext-tools/misc/ChangeLog | 7 +++++++ gettext-tools/misc/autopoint.in | 12 +++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/gettext-tools/misc/ChangeLog b/gettext-tools/misc/ChangeLog index c94359827..6351aceeb 100644 --- a/gettext-tools/misc/ChangeLog +++ b/gettext-tools/misc/ChangeLog @@ -1,3 +1,10 @@ +2013-01-07 Daiki Ueno + + * autopoint.in: Extract version number from configure.ac in a more + robust way. + Reported by Tom G. Christensen in + . + 2012-12-25 Daiki Ueno * autopoint.in: Update for 0.18.2. diff --git a/gettext-tools/misc/autopoint.in b/gettext-tools/misc/autopoint.in index dd7e20313..717b0db5e 100644 --- a/gettext-tools/misc/autopoint.in +++ b/gettext-tools/misc/autopoint.in @@ -267,9 +267,15 @@ fi # Check whether the -V option and the version number in configure.in match. # At least one of the two must be given. If both are given, they must agree. -sed_extract_AM_GNU_GETTEXT_VERSION_argument='s/^AM_GNU_GETTEXT_VERSION(\([^()]*\)).*$/\1/' -sed_remove_outer_brackets='s/^\[\(.*\)\]$/\1/' -xver=`cat "$configure_in" | grep '^AM_GNU_GETTEXT_VERSION(' | sed -n -e "$sed_extract_AM_GNU_GETTEXT_VERSION_argument"p | sed -e "$sed_remove_outer_brackets" | sed -e 1q` +sed_extract_AM_GNU_GETTEXT_VERSION_argument=' +s,#.*$,,; s,^dnl .*$,,; s, dnl .*$,,; +/AM_GNU_GETTEXT_VERSION/ { + s,^.*AM_GNU_GETTEXT_VERSION(\([^()]*\)).*$,xver=\1, + s,^xver=\[\(.*\)\]$,xver=\1, + p +} +d' +eval `sed "$sed_extract_AM_GNU_GETTEXT_VERSION_argument" "$configure_in"` if test -z "$xver" && test -f intl/VERSION; then xver=`cat intl/VERSION | LC_ALL=C sed -n -e 's/^.*gettext-\([-+_.0-9A-Za-z]*\).*$/\1/p'` fi -- 2.47.2