From: Paul Eggert Date: Mon, 15 Nov 2010 18:18:52 +0000 (-0800) Subject: bootstrap: port to Solaris sed X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a922a35f32adc0d332f207ec2abccfac45d40358;p=pspp bootstrap: port to Solaris sed * build-aux/bootstrap (get_version): Port to Solaris sed. See Ralf Wildenhues's note in . --- diff --git a/ChangeLog b/ChangeLog index b407e8aa6a..0e6240c908 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-11-15 Paul Eggert + + bootstrap: port to Solaris sed + * build-aux/bootstrap (get_version): Port to Solaris sed. + See Ralf Wildenhues's note in + . + 2010-11-14 Jim Meyering maint.mk: rename variable: s/noteworthy/gl_noteworthy_news_/ 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