summaryrefslogtreecommitdiff
path: root/build-aux
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2022-12-27 08:15:38 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2022-12-27 10:02:42 -0800
commit816b0d5d6204d86c9501439ae4c5880d9b337200 (patch)
tree15599e373d0fe33d7230a24d778b766382f15acd /build-aux
parent8319b1927b2763e7b0bb39a0c5a310078f2dfe86 (diff)
downloadgnulib-816b0d5d6204d86c9501439ae4c5880d9b337200.tar.gz
Support packages with just 'bootstrap'
* top/bootstrap: With --version, also output library version. Support update of package that has only the bootstrap script, and not the other three files. * top/bootstrap-funclib.sh (scriptlibversion): Rename from scriptversion. All uses changed. This way we can distinguish script from script library versions. (upgrade_bootstrap): If the package currently has only the bootstrap script, just update that.
Diffstat (limited to 'build-aux')
-rwxr-xr-xbuild-aux/bootstrap46
1 files changed, 24 insertions, 22 deletions
diff --git a/build-aux/bootstrap b/build-aux/bootstrap
index 2c81b0f26e..d40cd01162 100755
--- a/build-aux/bootstrap
+++ b/build-aux/bootstrap
@@ -1,11 +1,9 @@
#! /bin/sh
# DO NOT EDIT! GENERATED AUTOMATICALLY!
-# This script is only a trampoline that fetches the companion scripts
-# (bootstrap-funclib.sh, autopull.sh, autogen.sh).
# Bootstrap this package from checked-out sources.
-scriptversion=2022-12-27.04; # UTC
+scriptversion=2022-12-27.05; # UTC
# Copyright (C) 2003-2022 Free Software Foundation, Inc.
#
@@ -39,7 +37,7 @@ medir=`dirname "$me"`
# A library of shell functions for autopull.sh, autogen.sh, and bootstrap.
-scriptversion=2022-12-27.16; # UTC
+scriptlibversion=2022-12-27.16; # UTC
# Copyright (C) 2003-2022 Free Software Foundation, Inc.
#
@@ -77,7 +75,7 @@ PERL="${PERL-perl}"
default_gnulib_url=https://git.savannah.gnu.org/git/gnulib.git
# Copyright year, for the --version output.
-copyright_year=`echo "$scriptversion" | sed -e 's/[^0-9].*//'`
+copyright_year=`echo "$scriptlibversion" | sed -e 's/[^0-9].*//'`
copyright="Copyright (C) ${copyright_year} Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <https://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
@@ -593,18 +591,28 @@ prepare_GNULIB_SRCDIR ()
upgrade_bootstrap ()
{
- { cmp -s "$medir"/bootstrap "$GNULIB_SRCDIR/top/bootstrap" \
- && cmp -s "$medir"/bootstrap-funclib.sh "$GNULIB_SRCDIR/top/bootstrap-funclib.sh" \
- && cmp -s "$medir"/autopull.sh "$GNULIB_SRCDIR/top/autopull.sh" \
- && cmp -s "$medir"/autogen.sh "$GNULIB_SRCDIR/top/autogen.sh"; \
- } || {
- echo "$0: updating bootstrap & companions and restarting..."
+ if test -f "$medir"/bootstrap-funclib.sh; then
+ update_lib=true
+ { cmp -s "$medir"/bootstrap "$GNULIB_SRCDIR/top/bootstrap" \
+ && cmp -s "$medir"/bootstrap-funclib.sh "$GNULIB_SRCDIR/top/bootstrap-funclib.sh" \
+ && cmp -s "$medir"/autopull.sh "$GNULIB_SRCDIR/top/autopull.sh" \
+ && cmp -s "$medir"/autogen.sh "$GNULIB_SRCDIR/top/autogen.sh"; \
+ }
+ else
+ update_lib=false
+ cmp -s "$medir"/bootstrap "$GNULIB_SRCDIR/build-aux/bootstrap"
+ fi || {
+ if $update_lib; then
+ echo "$0: updating bootstrap & companions and restarting..."
+ else
+ echo "$0: updating bootstrap and restarting..."
+ fi
case $(sh -c 'echo "$1"' -- a) in
a) ignored=--;;
*) ignored=ignored;;
esac
exec sh -c \
- '{ if test -f "$1"; then cp "$1" "$3"; else cp "$2" "$3"; fi; } && { if test -f "$4"; then cp "$4" "$5"; else rm -f "$5"; fi; } && { if test -f "$6"; then cp "$6" "$7"; else rm -f "$7"; fi; } && { if test -f "$8"; then cp "$8" "$9"; else rm -f "$9"; fi; } && shift && shift && shift && shift && shift && shift && shift && shift && shift && exec "${CONFIG_SHELL-/bin/sh}" "$@"' \
+ '{ if '$update_lib' && test -f "$1"; then cp "$1" "$3"; else cp "$2" "$3"; fi; } && { if '$update_lib' && test -f "$4"; then cp "$4" "$5"; else rm -f "$5"; fi; } && { if '$update_lib' && test -f "$6"; then cp "$6" "$7"; else rm -f "$7"; fi; } && { if '$update_lib' && test -f "$8"; then cp "$8" "$9"; else rm -f "$9"; fi; } && shift && shift && shift && shift && shift && shift && shift && shift && shift && exec "${CONFIG_SHELL-/bin/sh}" "$@"' \
$ignored \
"$GNULIB_SRCDIR/top/bootstrap" "$GNULIB_SRCDIR/build-aux/bootstrap" "$medir/bootstrap" \
"$GNULIB_SRCDIR/top/bootstrap-funclib.sh" "$medir/bootstrap-funclib.sh" \
@@ -719,7 +727,7 @@ autopull()
return;;
--version)
set -e
- echo "autopull.sh $scriptversion"
+ echo "autopull.sh $scriptlibversion"
echo "$copyright"
return 0
;;
@@ -1051,7 +1059,7 @@ autogen()
return;;
--version)
set -e
- echo "autogen.sh $scriptversion"
+ echo "autogen.sh $scriptlibversion"
echo "$copyright"
return 0
;;
@@ -1307,7 +1315,7 @@ autogen()
# Local Variables:
# eval: (add-hook 'before-save-hook 'time-stamp)
-# time-stamp-start: "scriptversion="
+# time-stamp-start: "scriptlibversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
@@ -1411,7 +1419,7 @@ do
exit;;
--version)
set -e
- echo "bootstrap $scriptversion"
+ echo "bootstrap $scriptversion lib $scriptlibversion"
echo "$copyright"
exit 0
;;
@@ -1447,12 +1455,6 @@ fi
check_build_prerequisites $use_git
-if ! test -f "$medir"/bootstrap-funclib.sh; then
- # We have only completed the first phase of an upgrade from a bootstrap
- # version < 2022-07-24. Need to do the second phase now.
- bootstrap_sync=true
-fi
-
if $bootstrap_sync; then
prepare_GNULIB_SRCDIR
upgrade_bootstrap