diff options
author | Eric Blake <eblake@redhat.com> | 2016-11-03 13:50:30 -0500 |
---|---|---|
committer | Eric Blake <eblake@redhat.com> | 2016-11-04 10:13:56 -0500 |
commit | 4f9007e2467788fee5e08ba5df20aebab9d4a373 (patch) | |
tree | decc4d1af5240423f9e3553fa33ae5976686a4be /build-aux | |
parent | 5833fd5de856045558d77dbdea51f7dee702483b (diff) | |
download | gnulib-4f9007e2467788fee5e08ba5df20aebab9d4a373.tar.gz |
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>
Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'build-aux')
-rwxr-xr-x | build-aux/bootstrap | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/build-aux/bootstrap b/build-aux/bootstrap index f060bab83e..5d3c2898cf 100755 --- a/build-aux/bootstrap +++ b/build-aux/bootstrap @@ -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() { |