summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel E. Denny <joeldenny@joeldenny.org>2010-11-20 09:37:45 -0500
committerJoel E. Denny <joeldenny@joeldenny.org>2010-11-21 09:49:52 -0500
commit9aa2d4c522f12870229df0fd01d3140bddf94317 (patch)
tree04a9129cd99520631f1610afe3557635f7b5296d
parent454d8990999cb6f0a2c60ccad2de6eb5bbeae45f (diff)
downloadgnulib-9aa2d4c522f12870229df0fd01d3140bddf94317.tar.gz
bootstrap: add bootstrap_sync option.
See discussion at <http://lists.gnu.org/archive/html/bug-gnulib/2010-10/msg00369.html>, <http://lists.gnu.org/archive/html/bug-gnulib/2010-11/msg00200.html>. * build-aux/bootstrap: Accept --bootstrap-sync to update bootstrap if it is not identical to the local gnulib's bootstrap. Accept bootstrap_sync=true in bootstrap.conf to enable this by default. Accept --no-bootstrap-sync to disable it.
-rw-r--r--ChangeLog12
-rwxr-xr-xbuild-aux/bootstrap26
2 files changed, 37 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index f17c793c63..20a4af90b5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2010-11-20 Joel E. Denny <joeldenny@joeldenny.org>
+
+ bootstrap: add bootstrap_sync option.
+ See discussion at
+ <http://lists.gnu.org/archive/html/bug-gnulib/2010-10/msg00369.html>,
+ <http://lists.gnu.org/archive/html/bug-gnulib/2010-11/msg00200.html>.
+ * build-aux/bootstrap: Accept --bootstrap-sync to update
+ bootstrap if it is not identical to the local gnulib's
+ bootstrap. Accept bootstrap_sync=true in bootstrap.conf to
+ enable this by default. Accept --no-bootstrap-sync to disable
+ it.
+
2010-11-20 Bruno Haible <bruno@clisp.org>
Ensure that <features.h> is included before __GLIBC__ is tested.
diff --git a/build-aux/bootstrap b/build-aux/bootstrap
index 12fec20ecc..dcd4773973 100755
--- a/build-aux/bootstrap
+++ b/build-aux/bootstrap
@@ -1,6 +1,6 @@
#! /bin/sh
# Print a version string.
-scriptversion=2010-11-12.21; # 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;;
@@ -501,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