summaryrefslogtreecommitdiff
path: root/bootstrap
diff options
context:
space:
mode:
authorBertrand Garrigues <bertrand.garrigues@laposte.net>2017-02-23 22:52:31 +0100
committerBertrand Garrigues <bertrand.garrigues@laposte.net>2017-02-23 22:52:31 +0100
commit70c3b9e27d76277e723f93334d2c912c2905d4eb (patch)
tree98419048dff5f743eb52a49951f24466cdedb2b7 /bootstrap
parent4b3e5417d53d16ac41ccf6a835840ecde1f97a83 (diff)
downloadgroff-git-70c3b9e27d76277e723f93334d2c912c2905d4eb.tar.gz
* bootstrap: update with latest version from gnulib.
* gnulib: update the git submodule with latest version (commit 4084b3a1094372b960ce4a97634e08f4538c8bdd from gnulib).
Diffstat (limited to 'bootstrap')
-rwxr-xr-xbootstrap83
1 files changed, 56 insertions, 27 deletions
diff --git a/bootstrap b/bootstrap
index ce90bc419..932ff85e7 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1,10 +1,10 @@
#! /bin/sh
# Print a version string.
-scriptversion=2013-12-05.23; # UTC
+scriptversion=2017-01-09.19; # UTC
# Bootstrap this package from checked-out sources.
-# Copyright (C) 2003-2014 Free Software Foundation, Inc.
+# Copyright (C) 2003-2017 Free Software Foundation, Inc.
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -42,6 +42,9 @@ export LC_ALL
local_gl_dir=gl
+# Honor $PERL, but work even if there is none.
+PERL="${PERL-perl}"
+
me=$0
usage() {
@@ -210,7 +213,17 @@ bootstrap_sync=false
use_git=true
check_exists() {
- ($1 --version </dev/null) >/dev/null 2>&1
+ if test "$1" = "--verbose"; then
+ ($2 --version </dev/null) >/dev/null 2>&1
+ if test $? -ge 126; then
+ # If not found, run with diagnostics as one may be
+ # presented with env variables to set to find the right version
+ ($2 --version </dev/null)
+ fi
+ else
+ ($1 --version </dev/null) >/dev/null 2>&1
+ fi
+
test $? -lt 126
}
@@ -405,28 +418,30 @@ sort_ver() { # sort -V is not generally available
done
}
-get_version() {
- app=$1
+get_version_sed='
+# Move version to start of line.
+s/.*[v ]\([0-9]\)/\1/
+
+# Skip lines that do not start with version.
+/^[0-9]/!d
- $app --version >/dev/null 2>&1 || return 1
+# Remove characters after the version.
+s/[^.a-z0-9-].*//
- $app --version 2>&1 |
- sed -n '# Move version to start of line.
- s/.*[v ]\([0-9]\)/\1/
+# The first component must be digits only.
+s/^\([0-9]*\)[a-z-].*/\1/
- # Skip lines that do not start with version.
- /^[0-9]/!d
+#the following essentially does s/5.005/5.5/
+s/\.0*\([1-9]\)/.\1/g
+p
+q'
- # Remove characters after the version.
- s/[^.a-z0-9-].*//
+get_version() {
+ app=$1
- # The first component must be digits only.
- s/^\([0-9]*\)[a-z-].*/\1/
+ $app --version >/dev/null 2>&1 || { $app --version; return 1; }
- #the following essentially does s/5.005/5.5/
- s/\.0*\([1-9]\)/.\1/g
- p
- q'
+ $app --version 2>&1 | sed -n "$get_version_sed"
}
check_versions() {
@@ -446,6 +461,7 @@ check_versions() {
test "$appvar" = TAR && appvar=AMTAR
case $appvar in
GZIP) ;; # Do not use $GZIP: it contains gzip options.
+ PERL::*) ;; # Keep perl modules as-is
*) eval "app=\${$appvar-$app}" ;;
esac
@@ -463,11 +479,22 @@ check_versions() {
ret=1
continue
} ;;
+ # Another check is for perl modules. These can be written as
+ # e.g. perl::XML::XPath in case of XML::XPath module, etc.
+ perl::*)
+ # Extract module name
+ app="${app#perl::}"
+ if ! $PERL -m"$app" -e 'exit 0' >/dev/null 2>&1; then
+ warn_ "Error: perl module '$app' not found"
+ ret=1
+ fi
+ continue
+ ;;
esac
if [ "$req_ver" = "-" ]; then
# Merely require app to exist; not all prereq apps are well-behaved
# so we have to rely on $? rather than get_version.
- if ! check_exists $app; then
+ if ! check_exists --verbose $app; then
warn_ "Error: '$app' not found"
ret=1
fi
@@ -598,8 +625,8 @@ case ${GNULIB_SRCDIR--} in
# Note that $use_git is necessarily true in this case.
if git_modules_config submodule.gnulib.url >/dev/null; then
echo "$0: getting gnulib files..."
- git submodule init || exit $?
- git submodule update || exit $?
+ git submodule init -- "$gnulib_path" || exit $?
+ git submodule update -- "$gnulib_path" || exit $?
elif [ ! -d "$gnulib_path" ]; then
echo "$0: getting gnulib files..."
@@ -628,13 +655,14 @@ case ${GNULIB_SRCDIR--} in
# This fallback allows at least git 1.5.5.
if test -f "$gnulib_path"/gnulib-tool; then
# Since file already exists, assume submodule init already complete.
- git submodule update || exit $?
+ git submodule update -- "$gnulib_path" || exit $?
else
# Older git can't clone into an empty directory.
rmdir "$gnulib_path" 2>/dev/null
git clone --reference "$GNULIB_SRCDIR" \
"$(git_modules_config submodule.gnulib.url)" "$gnulib_path" \
- && git submodule init && git submodule update \
+ && git submodule init -- "$gnulib_path" \
+ && git submodule update -- "$gnulib_path" \
|| exit $?
fi
fi
@@ -762,7 +790,7 @@ symlink_to_dir()
# Leave any existing symlink alone, if it already points to the source,
# so that broken build tools that care about symlink times
# aren't confused into doing unnecessary builds. Conversely, if the
- # existing symlink's time stamp is older than the source, make it afresh,
+ # existing symlink's timestamp is older than the source, make it afresh,
# so that broken tools aren't confused into skipping needed builds. See
# <http://lists.gnu.org/archive/html/bug-gnulib/2011-05/msg00326.html>.
test -h "$dst" &&
@@ -889,7 +917,8 @@ if test $use_libtool = 1; then
esac
fi
echo "$0: $gnulib_tool $gnulib_tool_options --import ..."
-$gnulib_tool $gnulib_tool_options --import $gnulib_modules &&
+$gnulib_tool $gnulib_tool_options --import $gnulib_modules \
+ || die "gnulib-tool failed"
for file in $gnulib_files; do
symlink_to_dir "$GNULIB_SRCDIR" $file \
@@ -994,6 +1023,6 @@ echo "$0: done. Now you can run './configure'."
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End: