changeset 13872:a7f5aea6a5a7

bootstrap: port to Solaris sed * build-aux/bootstrap (get_version): Port to Solaris sed. See Ralf Wildenhues's note in <http://lists.gnu.org/archive/html/bug-gnulib/2010-11/msg00156.html>.
author Paul Eggert <eggert@cs.ucla.edu>
date Mon, 15 Nov 2010 10:18:52 -0800
parents 8c865631b168
children a6de2bd905fe
files ChangeLog build-aux/bootstrap
diffstat 2 files changed, 16 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2010-11-15  Paul Eggert  <eggert@cs.ucla.edu>
+
+	bootstrap: port to Solaris sed
+	* build-aux/bootstrap (get_version): Port to Solaris sed.
+	See Ralf Wildenhues's note in
+	<http://lists.gnu.org/archive/html/bug-gnulib/2010-11/msg00156.html>.
+
 2010-11-14  Jim Meyering  <meyering@redhat.com>
 
 	maint.mk: rename variable: s/noteworthy/gl_noteworthy_news_/
--- a/build-aux/bootstrap
+++ b/build-aux/bootstrap
@@ -344,17 +344,18 @@
   $app --version >/dev/null 2>&1 || return 1
 
   $app --version 2>&1 |
-  sed -n '# extract version within line
-          s/.*[v ]\{1,\}\([0-9]\{1,\}\(\.[.a-z0-9-]*\)*\).*/\1/
-          t done
+  sed -n '# Move version to start of line.
+          s/.*[v ]\([0-9]\)/\1/
+
+          # Skip lines that do not start with version.
+          /^[0-9]/!d
 
-          # extract version at start of line
-          s/^\([0-9]\{1,\}\(\.[.a-z0-9-]*\)*\).*/\1/
-          t done
+          # Remove characters after the version.
+          s/[^.a-z0-9-].*//
 
-          d
+          # The first component must be digits only.
+          s/^\([0-9]*\)[a-z-].*/\1/
 
-          :done
           #the following essentially does s/5.005/5.5/
           s/\.0*\([1-9]\)/.\1/g
           p