# HG changeset patch # User Eric Blake # Date 1368044959 21600 # Node ID 71ec5ab03eb8d0e732317fb6191203990e9f0350 # Parent f0016636cc7557577c81d4915980670903fcea60 bootstrap: AC_INIT may have more than four parameters For packages that did AC_INIT([package], [version], [bug-report], [], [url]) the extraction script was grabbing url instead of package for the value of $package. Furthermore, while we guarantee LC_ALL=C, this code is liable to be copied and pasted to a script that doesn't use the C locale and thus where a range expression may misbehave. * build-aux/bootstrap (extract_package_name): Correctly extract non-empty tarname field. Avoid range in regex. Based on a report by Sami Kerola . Signed-off-by: Eric Blake diff -r f0016636cc75 -r 71ec5ab03eb8 ChangeLog --- a/ChangeLog Wed May 08 14:32:11 2013 -0600 +++ b/ChangeLog Wed May 08 14:29:19 2013 -0600 @@ -1,3 +1,10 @@ +2013-05-08 Eric Blake + + bootstrap: AC_INIT may have more than four parameters + * build-aux/bootstrap (extract_package_name): Correctly extract + non-empty tarname field. Avoid range in regex. + Based on a report by Sami Kerola . + 2013-05-07 Paul Eggert qacl: port to MS-Windows port of GNU Emacs diff -r f0016636cc75 -r 71ec5ab03eb8 build-aux/bootstrap --- a/build-aux/bootstrap Wed May 08 14:32:11 2013 -0600 +++ b/build-aux/bootstrap Wed May 08 14:29:19 2013 -0600 @@ -1,6 +1,6 @@ #! /bin/sh # Print a version string. -scriptversion=2013-03-08.16; # UTC +scriptversion=2013-05-08.20; # UTC # Bootstrap this package from checked-out sources. @@ -140,20 +140,21 @@ "wget --mirror -nd -q -np -A.po -P '%s' \ http://translationproject.org/latest/%s/" +# Prefer a non-empty tarname (4th argument of AC_INIT if given), else +# fall back to the package name (1st argument with munging) extract_package_name=' - /^AC_INIT(/{ - /.*,.*,.*, */{ - s/// - s/[][]//g - s/)$// + /^AC_INIT(\[*/{ + s/// + /^[^,]*,[^,]*,[^,]*,[ []*\([^][ ,)]\)/{ + s//\1/ + s/[],)].*// p q } - s/AC_INIT(\[*// - s/]*,.*// + s/[],)].*// s/^GNU // y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ - s/[^A-Za-z0-9_]/-/g + s/[^abcdefghijklmnopqrstuvwxyz0123456789_]/-/g p } '