Mercurial > octave
changeset 33467:c51b07a71421
update to latest gnulib revision d4ec02b3cc70cddaaa5183cc5a45814e0afb2292
This version is current as of the date of this commit and now uses
the Python implementation of gnulib-tool if a suitable puthon3
program is found in $PATH.
* autogen.sh, autopull.sh, bootstrap, bootstrap-funclib.sh:
Update from gnulib.
* bootstrap.conf: Set GNULIB_REVISION and update comments about our
local changes to bootstrap-funclib.sh.
* build-aux/gnulib-bootstrap-git-fetch.diff: Delete.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 26 Apr 2024 13:33:37 -0400 |
parents | 65cbf92800ed |
children | b295be7a77ca 321f49a98a85 |
files | autogen.sh autopull.sh bootstrap bootstrap-funclib.sh bootstrap.conf build-aux/gnulib-bootstrap-git-fetch.diff |
diffstat | 6 files changed, 128 insertions(+), 161 deletions(-) [+] |
line wrap: on
line diff
--- a/autogen.sh Fri Apr 26 13:08:25 2024 +0800 +++ b/autogen.sh Fri Apr 26 13:33:37 2024 -0400 @@ -4,7 +4,7 @@ # also regenerates all aclocal.m4, config.h.in, Makefile.in, configure files # with new versions of autoconf or automake. -# Copyright (C) 2003-2023 Free Software Foundation, Inc. +# Copyright (C) 2003-2024 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
--- a/autopull.sh Fri Apr 26 13:08:25 2024 +0800 +++ b/autopull.sh Fri Apr 26 13:33:37 2024 -0400 @@ -2,7 +2,7 @@ # Convenience script for fetching auxiliary files that are omitted from # the version control repository of this package. -# Copyright (C) 2003-2023 Free Software Foundation, Inc. +# Copyright (C) 2003-2024 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
--- a/bootstrap Fri Apr 26 13:08:25 2024 +0800 +++ b/bootstrap Fri Apr 26 13:33:37 2024 -0400 @@ -1,9 +1,9 @@ #! /bin/sh # Bootstrap this package from checked-out sources. -scriptversion=2023-08-29.21; # UTC +scriptversion=2024-04-13.15; # UTC -# Copyright (C) 2003-2023 Free Software Foundation, Inc. +# Copyright (C) 2003-2024 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 @@ -43,44 +43,55 @@ GNULIB_SRCDIR Specifies the local directory where gnulib sources reside. Use this if you already have gnulib sources on your machine, and - do not want to waste your bandwidth downloading - them again. - GNULIB_URL URL of the gnulib repository. The default is - $default_gnulib_url, - which is Gnulib's upstream repository. - -Options: - - --pull Do phase 1: pull files from network - --gen Do phase 2: generate from local files. - (The default is to do both phases.) - - --gnulib-srcdir=DIRNAME specify the local directory where gnulib - sources reside. Use this if you already - have gnulib sources on your machine, and - you want to use these sources. Defaults - to \$GNULIB_SRCDIR - --gnulib-refdir=DIRNAME specify the local directory where a gnulib + you want to use these sources. + GNULIB_REFDIR Specifies the local directory where a gnulib repository (with a .git subdirectory) resides. Use this if you already have gnulib sources and history on your machine, and do not want to waste your bandwidth downloading them again. - Defaults to \$GNULIB_REFDIR + Only used for phase 1 (--pull). + GNULIB_URL URL of the gnulib repository. The default is + $default_gnulib_url, + which is Gnulib's upstream repository. + Only used for phase 1 (--pull). + +Options: + + --pull Do phase 1: Pull files from the network. + --gen Do phase 2: Generate files from local files + (no network access). + (The default is to do both phases.) - --bootstrap-sync if this bootstrap script is not identical to + --gnulib-srcdir=DIRNAME Specifies the local directory where gnulib + sources reside. Use this if you already + have gnulib sources on your machine, and + you want to use these sources. Defaults + to \$GNULIB_SRCDIR. + --gnulib-refdir=DIRNAME Specifies the local directory where a gnulib + repository (with a .git subdirectory) resides. + Use this if you already have gnulib sources + and history on your machine, and do not want + to waste your bandwidth downloading them again. + Defaults to \$GNULIB_REFDIR. + Only used for phase 1 (--pull). + + --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 - --no-bootstrap-sync do not check whether bootstrap is out of sync + /bin/sh or the shell \$CONFIG_SHELL. + --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 - --no-git do not use git to update gnulib. Requires that + --copy Copy files instead of creating symbolic links. + Only used for phase 2 (--gen). + --force Attempt to bootstrap even if the sources seem + not to have been checked out. + --no-git Do not use git to update gnulib. Requires that \$GNULIB_SRCDIR or the --gnulib-srcdir option points to a gnulib repository with the correct - revision - --skip-po do not download po files + revision. + Only used for phase 1 (--pull). + --skip-po Do not download *.po files. + Only used for phase 1 (--pull). EOF bootstrap_print_option_usage_hook cat <<EOF @@ -92,11 +103,11 @@ Gnulib sources can be fetched in various ways: - * If the environment variable GNULIB_SRCDIR is set (either as an - environment variable or via the --gnulib-srcdir option), then sources - are fetched from that local directory. If it is a git repository and - the configuration variable GNULIB_REVISION is set in bootstrap.conf, - then that revision is checked out. + * If GNULIB_SRCDIR is set (either as an environment variable or via the + --gnulib-srcdir option), then sources are fetched from that local + directory. If it is a git repository and the configuration variable + GNULIB_REVISION is set in bootstrap.conf, then that revision is + checked out. * Otherwise, if this package is in a git repository with a 'gnulib' submodule configured, then that submodule is initialized and updated @@ -192,7 +203,7 @@ if $bootstrap_sync; then prepare_GNULIB_SRCDIR - upgrade_bootstrap + upgrade_bootstrap "$@" # Since we have now upgraded if needed, no need to try it a second time below. bootstrap_sync=false fi @@ -217,10 +228,10 @@ fi if $gen; then - autogen \ - `if $copy; then echo ' --copy'; fi` \ - `if test -z "$checkout_only_file"; then echo ' --force'; fi` \ - || die "could not generate auxiliary files" + autogen \ + `if $copy; then echo ' --copy'; fi` \ + `if test -z "$checkout_only_file"; then echo ' --force'; fi` \ + || die "could not generate auxiliary files" fi # ----------------------------------------------------------------------------
--- a/bootstrap-funclib.sh Fri Apr 26 13:08:25 2024 +0800 +++ b/bootstrap-funclib.sh Fri Apr 26 13:33:37 2024 -0400 @@ -1,8 +1,8 @@ # A library of shell functions for autopull.sh, autogen.sh, and bootstrap. -scriptlibversion=2023-08-29.21; # UTC +scriptlibversion=2024-04-13.15; # UTC -# Copyright (C) 2003-2023 Free Software Foundation, Inc. +# Copyright (C) 2003-2024 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 @@ -441,10 +441,9 @@ # --------------------- Preparing GNULIB_SRCDIR for use. --------------------- # This is part of autopull.sh, but bootstrap needs it too, for self-upgrading. +# cleanup_gnulib fails, removing the directory $gnulib_path first. cleanup_gnulib() { status=$? - # XXX It's a bad idea to erase the submodule directory if it contains local - # modifications. rm -fr "$gnulib_path" exit $status } @@ -462,48 +461,44 @@ test -f "$GNULIB_SRCDIR/gnulib-tool" \ || die "Error: --gnulib-srcdir or \$GNULIB_SRCDIR is specified," \ "but does not contain gnulib-tool" - elif $use_git; then + if test -n "$GNULIB_REVISION" && $use_git; then + (cd "$GNULIB_SRCDIR" && git checkout "$GNULIB_REVISION") || exit $? + fi + else + if ! $use_git; then + die "Error: --no-git is specified," \ + "but neither --gnulib-srcdir nor \$GNULIB_SRCDIR is specified" + fi + if git submodule -h | grep -- --reference > /dev/null; then + : + else + die "git version is too old, git >= 1.6.4 is required" + fi gnulib_path=$(git_modules_config submodule.gnulib.path) - test -z "$gnulib_path" && gnulib_path=gnulib - - # Get gnulib files. Populate $gnulib_path, possibly updating a - # submodule, for use in the rest of the script. - - if test -n "$GNULIB_REFDIR" && test -d "$GNULIB_REFDIR"/.git \ - && git_modules_config submodule.gnulib.url >/dev/null; then - # Use GNULIB_REFDIR as a reference. - echo "$0: getting gnulib files..." - if git submodule -h|grep -- --reference > /dev/null; then - # Prefer the one-liner available in git 1.6.4 or newer. - git submodule update --init --reference "$GNULIB_REFDIR" \ - "$gnulib_path" || exit $? + if test -n "$gnulib_path"; then + # A submodule 'gnulib' is configured. + # Get gnulib files. Populate $gnulib_path, updating the submodule. + if test -n "$GNULIB_REFDIR" && test -d "$GNULIB_REFDIR"/.git; then + # Use GNULIB_REFDIR as a reference. + echo "$0: getting gnulib files..." + git submodule update --init --reference "$GNULIB_REFDIR" "$gnulib_path" \ + || exit $? else - # 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. + # GNULIB_REFDIR is not set or not usable. Ignore it. + if git_modules_config submodule.gnulib.url >/dev/null; then + echo "$0: getting gnulib files..." + git submodule init -- "$gnulib_path" || 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_REFDIR" \ - "$(git_modules_config submodule.gnulib.url)" "$gnulib_path" \ - && git submodule init -- "$gnulib_path" \ - && git submodule update -- "$gnulib_path" \ - || exit $? + die "Error: submodule 'gnulib' has no configured url" fi fi else - # GNULIB_REFDIR is not set or not usable. Ignore it. - if git_modules_config submodule.gnulib.url >/dev/null; then + gnulib_path='gnulib' + if test ! -d "$gnulib_path"; then + # The subdirectory 'gnulib' does not yet exist. Clone into it. echo "$0: getting gnulib files..." - git submodule init -- "$gnulib_path" || exit $? - git submodule update -- "$gnulib_path" || exit $? - - elif [ ! -d "$gnulib_path" ]; then - echo "$0: getting gnulib files..." - trap cleanup_gnulib HUP INT PIPE TERM - shallow= if test -z "$GNULIB_REVISION"; then if git clone -h 2>&1 | grep -- --depth > /dev/null; then @@ -525,39 +520,32 @@ # is without fetching all commits. So fall back to fetching all # commits. git -C "$gnulib_path" init - git -C "$gnulib_path" remote add origin \ - ${GNULIB_URL:-$default_gnulib_url} + git -C "$gnulib_path" remote add origin ${GNULIB_URL:-$default_gnulib_url} git -C "$gnulib_path" fetch $shallow origin "$GNULIB_REVISION" \ || git -C "$gnulib_path" fetch origin \ || cleanup_gnulib git -C "$gnulib_path" reset --hard FETCH_HEAD + (cd "$gnulib_path" && git checkout "$GNULIB_REVISION") || cleanup_gnulib fi - trap - HUP INT PIPE TERM - - elif test -n "$GNULIB_REVISION" \ - && ! git --git-dir="$gnulib_path"/.git cat-file \ - commit "$GNULIB_REVISION"; then - git --git-dir="$gnulib_path"/.git fetch + else + # The subdirectory 'gnulib' already exists. + if test -n "$GNULIB_REVISION"; then + if test -d "$gnulib_path/.git"; then + (cd "$gnulib_path" && git checkout "$GNULIB_REVISION") || exit 1 + else + die "Error: GNULIB_REVISION is specified in bootstrap.conf," \ + "but '$gnulib_path' contains no git history" + fi + fi fi fi - GNULIB_SRCDIR=$gnulib_path - # Verify that the submodule contains a gnulib checkout. + # Verify that $gnulib_path contains a gnulib checkout. test -f "$gnulib_path/gnulib-tool" \ - || die "Error: $gnulib_path is supposed to contain a gnulib checkout," \ + || die "Error: '$gnulib_path' is supposed to contain a gnulib checkout," \ "but does not contain gnulib-tool" + GNULIB_SRCDIR=$gnulib_path fi - - # XXX Should this be done if $use_git is false? - if test -d "$GNULIB_SRCDIR"/.git && test -n "$GNULIB_REVISION" \ - && ! git_modules_config submodule.gnulib.url >/dev/null; then - if ! git --git-dir="$GNULIB_SRCDIR"/.git cat-file \ - commit "$GNULIB_REVISION"; then - git --git-dir="$GNULIB_SRCDIR"/.git fetch - fi - (cd "$GNULIB_SRCDIR" && git checkout "$GNULIB_REVISION") || cleanup_gnulib - fi - # $GNULIB_SRCDIR now points to the version of gnulib to use, and # we no longer need to use git or $gnulib_path below here. } @@ -619,7 +607,8 @@ autopull_usage() { cat <<EOF Usage: $me [OPTION]... -Bootstrap this package from the checked-out sources. +Bootstrap this package from the checked-out sources, phase 1: +Pull files from the network. Optional environment variables: GNULIB_SRCDIR Specifies the local directory where gnulib @@ -636,18 +625,19 @@ which is Gnulib's upstream repository. Options: - --bootstrap-sync if this bootstrap script is not identical to + + --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 - --no-bootstrap-sync do not check whether bootstrap is out of sync - --force attempt to bootstrap even if the sources seem - not to have been checked out - --no-git do not use git to update gnulib. Requires that - \$GNULIB_SRCDIR or the --gnulib-srcdir option - points to a gnulib repository with the correct - revision - --skip-po do not download po files + /bin/sh or the shell \$CONFIG_SHELL. + --no-bootstrap-sync Do not check whether bootstrap is out of sync. + + --force Attempt to bootstrap even if the sources seem + not to have been checked out. + --no-git Do not use git to update gnulib. Requires that + \$GNULIB_SRCDIR points to a gnulib repository + with the correct revision. + --skip-po Do not download *.po files. EOF bootstrap_print_option_usage_hook cat <<EOF @@ -659,17 +649,16 @@ Gnulib sources can be fetched in various ways: - * If the environment variable GNULIB_SRCDIR is set (either as an - environment variable or via the --gnulib-srcdir option), then sources - are fetched from that local directory. If it is a git repository and - the configuration variable GNULIB_REVISION is set in bootstrap.conf, - then that revision is checked out. + * If the environment variable GNULIB_SRCDIR is set, then sources are + fetched from that local directory. If it is a git repository and the + configuration variable GNULIB_REVISION is set in bootstrap.conf, then + that revision is checked out. * Otherwise, if this package is in a git repository with a 'gnulib' submodule configured, then that submodule is initialized and updated - and sources are fetched from there. If GNULIB_REFDIR is set (either - as an environment variable or via the --gnulib-refdir option) and is - a git repository, then it is used as a reference. + and sources are fetched from there. If the environment variable + GNULIB_REFDIR is set and is a git repository, then it is used as a + reference. * Otherwise, if the 'gnulib' directory does not exist, Gnulib sources are cloned into that directory using git from \$GNULIB_URL, defaulting @@ -749,7 +738,7 @@ if $use_gnulib || $bootstrap_sync; then prepare_GNULIB_SRCDIR if $bootstrap_sync; then - upgrade_bootstrap + upgrade_bootstrap "$@" fi fi @@ -862,7 +851,8 @@ autogen_usage() { cat <<EOF Usage: $me [OPTION]... -Bootstrap this package from the checked-out sources. +Bootstrap this package from the checked-out sources, phase 2: +Generate files from local files (no network access). Optional environment variables: GNULIB_SRCDIR Specifies the local directory where gnulib @@ -871,9 +861,9 @@ you want to use these sources. Options: - --copy copy files instead of creating symbolic links - --force attempt to bootstrap even if the sources seem - not to have been checked out + --copy Copy files instead of creating symbolic links. + --force Attempt to bootstrap even if the sources seem + not to have been checked out. EOF bootstrap_print_option_usage_hook cat <<EOF
--- a/bootstrap.conf Fri Apr 26 13:08:25 2024 +0800 +++ b/bootstrap.conf Fri Apr 26 13:33:37 2024 -0400 @@ -200,14 +200,9 @@ # # ./bootstrap --bootstrap-sync # -# to update the ./bootstrap file from the selected gnulib revision, -# followed by -# -# patch -p1 -u < ./build-aux/gnulib-bootstrap-git-fetch.diff -# -# to apply local changes from build-aux/gnulib-bootstrap-git-fetch.diff +# to update the ./bootstrap file from the selected gnulib revision. -: ${GNULIB_REVISION=7a38f30f925db7d486460c18df41413f3c7ef74b} +: ${GNULIB_REVISION=d4ec02b3cc70cddaaa5183cc5a45814e0afb2292} # Don't check for translations since we don't have any in Octave yet. # This avoids the need for sha1sum or compatible utility in bootstrap.
--- a/build-aux/gnulib-bootstrap-git-fetch.diff Fri Apr 26 13:08:25 2024 +0800 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ -Update bootstrap script from upstream gnulib to automatically fetch from repository if needed - -See also: https://lists.gnu.org/archive/html/bug-gnulib/2020-08/msg00150.html - ---- ./bootstrap-funclib.sh.orig 2023-11-20 18:29:45.640064746 +0100 -+++ ./bootstrap-funclib.sh 2023-11-20 18:35:57.451241555 +0100 -@@ -534,6 +534,11 @@ - fi - - trap - HUP INT PIPE TERM -+ -+ elif test -n "$GNULIB_REVISION" \ -+ && ! git --git-dir="$gnulib_path"/.git cat-file \ -+ commit "$GNULIB_REVISION"; then -+ git --git-dir="$gnulib_path"/.git fetch - fi - fi - GNULIB_SRCDIR=$gnulib_path -@@ -546,6 +551,10 @@ - # XXX Should this be done if $use_git is false? - if test -d "$GNULIB_SRCDIR"/.git && test -n "$GNULIB_REVISION" \ - && ! git_modules_config submodule.gnulib.url >/dev/null; then -+ if ! git --git-dir="$GNULIB_SRCDIR"/.git cat-file \ -+ commit "$GNULIB_REVISION"; then -+ git --git-dir="$GNULIB_SRCDIR"/.git fetch -+ fi - (cd "$GNULIB_SRCDIR" && git checkout "$GNULIB_REVISION") || cleanup_gnulib - fi -