From: Daiki Ueno Date: Sun, 6 Jan 2013 23:09:09 +0000 (+0900) Subject: Make autopoint AM_GNU_GETTEXT_VERSION handling more robust. X-Git-Tag: v0.18.3~84 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a071c8a3cdff4f6487390ceeb720cc9ae66e1474;p=thirdparty%2Fgettext.git Make autopoint AM_GNU_GETTEXT_VERSION handling more robust. --- 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