]> Savannah Git Hosting - gnulib.git/commitdiff
bootstrap: Fix get_version() for AIX 5.3
authorEric Blake <eblake@redhat.com>
Thu, 3 Nov 2016 18:50:30 +0000 (13:50 -0500)
committerEric Blake <eblake@redhat.com>
Fri, 4 Nov 2016 15:13:56 +0000 (10:13 -0500)
* build-aux/bootstrap (get_version): Factor out sed script, since
indented comments choke AIX 5.3 sed.

Reported-by: Michael Felt <aixtools@gmail.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
ChangeLog
build-aux/bootstrap

index 79495a59a09d017b39529983180bebd7113b7c11..e5d7987f309a9dd4d5c434fed4c8bf7cbce42fcc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2016-11-03  Eric Blake  <eblake@redhat.com>
+
+       bootstrap: Fix get_version() for AIX 5.3
+       * build-aux/bootstrap (get_version): Factor out sed script, since
+       indented comments choke AIX 5.3 sed.
+       Reported-by: Michael Felt <aixtools@gmail.com>
+
 2016-11-03  Paul Eggert  <eggert@cs.ucla.edu>
 
        intprops: port to older XL C
index f060bab83e3e6e41348bee0fde26672cc0987ed7..5d3c2898cf6156b32698d4907c5988c5b833174d 100755 (executable)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Print a version string.
-scriptversion=2016-01-24.06; # UTC
+scriptversion=2016-11-03.18; # UTC
 
 # Bootstrap this package from checked-out sources.
 
@@ -418,28 +418,30 @@ sort_ver() { # sort -V is not generally available
   done
 }
 
-get_version() {
-  app=$1
+get_version_sed='
+# Move version to start of line.
+s/.*[v ]\([0-9]\)/\1/
 
-  $app --version >/dev/null 2>&1 || { $app --version; return 1; }
+# Skip lines that do not start with version.
+/^[0-9]/!d
 
-  $app --version 2>&1 |
-  sed -n '# Move version to start of line.
-          s/.*[v ]\([0-9]\)/\1/
+# Remove characters after the version.
+s/[^.a-z0-9-].*//
 
-          # Skip lines that do not start with version.
-          /^[0-9]/!d
+# The first component must be digits only.
+s/^\([0-9]*\)[a-z-].*/\1/
 
-          # Remove characters after the version.
-          s/[^.a-z0-9-].*//
+#the following essentially does s/5.005/5.5/
+s/\.0*\([1-9]\)/.\1/g
+p
+q'
 
-          # The first component must be digits only.
-          s/^\([0-9]*\)[a-z-].*/\1/
+get_version() {
+  app=$1
+
+  $app --version >/dev/null 2>&1 || { $app --version; return 1; }
 
-          #the following essentially does s/5.005/5.5/
-          s/\.0*\([1-9]\)/.\1/g
-          p
-          q'
+  $app --version 2>&1 | sed -n "$get_version_sed"
 }
 
 check_versions() {