]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Make autopoint AM_GNU_GETTEXT_VERSION handling more robust.
authorDaiki Ueno <ueno@gnu.org>
Sun, 6 Jan 2013 23:09:09 +0000 (08:09 +0900)
committerDaiki Ueno <ueno@gnu.org>
Sun, 6 Jan 2013 23:09:44 +0000 (08:09 +0900)
gettext-tools/misc/ChangeLog
gettext-tools/misc/autopoint.in

index c943598274497c28bb7cd4bfaf9fc5325711342c..6351aceebdee7e3d55d5d53129b21b88905e1f55 100644 (file)
@@ -1,3 +1,10 @@
+2013-01-07  Daiki Ueno  <ueno@gnu.org>
+
+       * autopoint.in: Extract version number from configure.ac in a more
+       robust way.
+       Reported by Tom G. Christensen in
+       <http://lists.gnu.org/archive/html/bug-gnulib/2013-01/msg00053.html>.
+
 2012-12-25  Daiki Ueno  <ueno@gnu.org>
 
        * autopoint.in: Update for 0.18.2.
index dd7e203133ed8077142dd9d74bc4c9e67176f450..717b0db5ea9bea22180342ba65d26ef22764ace8 100644 (file)
@@ -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