summaryrefslogtreecommitdiff
path: root/build-aux/bootstrap
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2013-05-08 14:29:19 -0600
committerEric Blake <eblake@redhat.com>2013-05-08 14:43:02 -0600
commit0f8ddbf1a13a93a4584afdd82f0f87e498a0db6f (patch)
tree6986ccf04b1a8a5a7b7dba758b5eae8bca4d57c7 /build-aux/bootstrap
parent628b80f57eeb9a928fe9cbb5687b990e43c945f4 (diff)
downloadgnulib-0f8ddbf1a13a93a4584afdd82f0f87e498a0db6f.tar.gz
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 <kerolasa@iki.fi>. Signed-off-by: Eric Blake <eblake@redhat.com>
Diffstat (limited to 'build-aux/bootstrap')
-rwxr-xr-xbuild-aux/bootstrap19
1 files changed, 10 insertions, 9 deletions
diff --git a/build-aux/bootstrap b/build-aux/bootstrap
index 96f1e76252..0cbea66e8f 100755
--- a/build-aux/bootstrap
+++ b/build-aux/bootstrap
@@ -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 @@ po_download_command_format2=\
"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
}
'