summaryrefslogtreecommitdiff
path: root/build-aux
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2010-11-15 10:18:52 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2010-11-15 10:19:43 -0800
commita922a35f32adc0d332f207ec2abccfac45d40358 (patch)
tree3f6ca88700a5b172c8e5446c92e5c11bc8068a60 /build-aux
parent321fd42fee5eb894decb2b8de93698071fac3c29 (diff)
downloadgnulib-a922a35f32adc0d332f207ec2abccfac45d40358.tar.gz
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>.
Diffstat (limited to 'build-aux')
-rwxr-xr-xbuild-aux/bootstrap17
1 files changed, 9 insertions, 8 deletions
diff --git a/build-aux/bootstrap b/build-aux/bootstrap
index 6c311c3fa1..12fec20ecc 100755
--- a/build-aux/bootstrap
+++ b/build-aux/bootstrap
@@ -344,17 +344,18 @@ get_version() {
$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/
- # extract version at start of line
- s/^\([0-9]\{1,\}\(\.[.a-z0-9-]*\)*\).*/\1/
- t done
+ # Skip lines that do not start with version.
+ /^[0-9]/!d
- d
+ # Remove characters after the version.
+ s/[^.a-z0-9-].*//
+
+ # 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