summaryrefslogtreecommitdiff
path: root/bootstrap
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2010-12-31 09:50:46 -0700
committerEric Blake <eblake@redhat.com>2010-12-31 09:50:46 -0700
commit6b3f52e94f88267abd918afe2204ac19f78a7093 (patch)
treeace915d21e08fe97f2a05a47967e73ab8907c1a0 /bootstrap
parent278491d2cc3238b32a82a9460a0153607105d50d (diff)
downloadcoreutils-6b3f52e94f88267abd918afe2204ac19f78a7093.tar.xz
maint: update to latest gnulib, for testsuite improvement
* gnulib: Update to latest for init.sh fix. * bootstrap: Resync from gnulib. * tests/init.sh: Likewise.
Diffstat (limited to 'bootstrap')
-rwxr-xr-xbootstrap43
1 files changed, 34 insertions, 9 deletions
diff --git a/bootstrap b/bootstrap
index 8c8d777da..dcd477397 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1,6 +1,6 @@
#! /bin/sh
# Print a version string.
-scriptversion=2010-10-08.16; # UTC
+scriptversion=2010-11-20.03; # UTC
# Bootstrap this package from checked-out sources.
@@ -54,6 +54,12 @@ Options:
have gnulib sources on your machine, and
do not want to waste your bandwidth downloading
them again. Defaults to \$GNULIB_SRCDIR.
+ --bootstrap-sync If this bootstrap script is not identical to
+ the version in the local gnulib sources,
+ update this script, and then restart it with
+ /bin/sh or the shell \$CONFIG_SHELL if
+ defined.
+ --no-bootstrap-sync Do not check whether bootstrap is out of sync.
--copy Copy files instead of creating symbolic links.
--force Attempt to bootstrap even if the sources seem
not to have been checked out.
@@ -168,6 +174,10 @@ copy=false
# on which version control system (if any) is used in the source directory.
vc_ignore=auto
+# Set this to true in bootstrap.conf to enable --bootstrap-sync by
+# default.
+bootstrap_sync=false
+
# find_tool ENVVAR NAMES...
# -------------------------
# Search for a required program. Use the value of ENVVAR, if set,
@@ -239,6 +249,10 @@ do
checkout_only_file=;;
--copy)
copy=true;;
+ --bootstrap-sync)
+ bootstrap_sync=true;;
+ --no-bootstrap-sync)
+ bootstrap_sync=false;;
*)
echo >&2 "$0: $option: unknown option"
exit 1;;
@@ -344,17 +358,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/
+
+ # Skip lines that do not start with version.
+ /^[0-9]/!d
- # extract version at start of line
- s/^\([0-9]\{1,\}\.[.a-z0-9-]*\).*/\1/
- t done
+ # Remove characters after the version.
+ s/[^.a-z0-9-].*//
- d
+ # 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
@@ -500,6 +515,16 @@ case ${GNULIB_SRCDIR--} in
;;
esac
+if $bootstrap_sync; then
+ cmp -s "$0" "$GNULIB_SRCDIR/build-aux/bootstrap" || {
+ echo "$0: updating bootstrap and restarting..."
+ exec sh -c \
+ 'cp "$1" "$2" && shift && exec "${CONFIG_SHELL-/bin/sh}" "$@"' \
+ -- "$GNULIB_SRCDIR/build-aux/bootstrap" \
+ "$0" "$@" --no-bootstrap-sync
+ }
+fi
+
gnulib_tool=$GNULIB_SRCDIR/gnulib-tool
<$gnulib_tool || exit