From 096abe4908834d96a7225218c18d08425aa48b90 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 24 Jul 2022 16:24:37 +0200 Subject: Split bootstrap into autopull.sh and autogen.sh. * top/bootstrap-funclib.sh: New file, based on build-aux/bootstrap. * top/autopull.sh: New file, based on build-aux/bootstrap. * top/autogen.sh: New file, based on build-aux/bootstrap. * top/bootstrap: New file, based on build-aux/bootstrap. * top/gen-bootstrap.sed: New file. * Makefile (build-aux/bootstrap): New rule. (regen): Depend on it. * build-aux/bootstrap: Regenerated using "make build-aux/bootstrap". --- top/autopull.sh | 273 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 273 insertions(+) create mode 100755 top/autopull.sh (limited to 'top/autopull.sh') diff --git a/top/autopull.sh b/top/autopull.sh new file mode 100755 index 0000000000..f4c0f49652 --- /dev/null +++ b/top/autopull.sh @@ -0,0 +1,273 @@ +#!/bin/sh +# Convenience script for fetching auxiliary files that are omitted from +# the version control repository of this package. + +# Copyright (C) 2003-2022 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 +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# Originally written by Paul Eggert. The canonical version of this +# script is maintained as build-aux/autopull.sh in gnulib. However, +# to be useful to your package, you should place a copy of it under +# version control in the top-level directory of your package. The +# intent is that all customization can be done with a bootstrap.conf +# file also maintained in your version control; gnulib comes with a +# template build-aux/bootstrap.conf to get you started. +# +# Alternatively, you can use an autopull.sh script that is specific +# to your package. + +scriptversion=2022-07-24.15; # UTC + +me="$0" +medir=`dirname "$me"` + +# Read the function library and the configuration. +. "$medir"/bootstrap-funclib.sh + +# Ensure that CDPATH is not set. Otherwise, the output from cd +# would cause trouble in at least one use below. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +usage() { + cat </dev/null ; then + : + elif check_exists git-merge-changelog; then + echo "$0: initializing git-merge-changelog driver" + git config merge.merge-changelog.name 'GNU-style ChangeLog merge driver' + git config merge.merge-changelog.driver 'git-merge-changelog %O %A %B' + else + echo "$0: consider installing git-merge-changelog from gnulib" + fi +fi + +# ----------------------------- Get translations. ----------------------------- + +download_po_files() { + subdir=$1 + domain=$2 + echo "$me: getting translations into $subdir for $domain..." + cmd=$(printf "$po_download_command_format" "$subdir" "$domain") + eval "$cmd" +} + +# Mirror .po files to $po_dir/.reference and copy only the new +# or modified ones into $po_dir. Also update $po_dir/LINGUAS. +# Note po files that exist locally only are left in $po_dir but will +# not be included in LINGUAS and hence will not be distributed. +update_po_files() { + # Directory containing primary .po files. + # Overwrite them only when we're sure a .po file is new. + po_dir=$1 + domain=$2 + + # Mirror *.po files into this dir. + # Usually contains *.s1 checksum files. + ref_po_dir="$po_dir/.reference" + + test -d $ref_po_dir || mkdir $ref_po_dir || return + download_po_files $ref_po_dir $domain \ + && ls "$ref_po_dir"/*.po 2>/dev/null | + sed 's|.*/||; s|\.po$||' > "$po_dir/LINGUAS" || return + + langs=$(cd $ref_po_dir && echo *.po | sed 's/\.po//g') + test "$langs" = '*' && langs=x + for po in $langs; do + case $po in x) continue;; esac + new_po="$ref_po_dir/$po.po" + cksum_file="$ref_po_dir/$po.s1" + if ! test -f "$cksum_file" || + ! test -f "$po_dir/$po.po" || + ! $SHA1SUM -c "$cksum_file" < "$new_po" > /dev/null 2>&1; then + echo "$me: updated $po_dir/$po.po..." + cp "$new_po" "$po_dir/$po.po" \ + && $SHA1SUM < "$new_po" > "$cksum_file" || return + fi + done +} + +case $SKIP_PO in +'') + if test -d po; then + update_po_files po $package || exit + fi + + if test -d runtime-po; then + update_po_files runtime-po $package-runtime || exit + fi;; +esac + +# ----------------------------------------------------------------------------- + +bootstrap_post_pull_hook \ + || die "bootstrap_post_pull_hook failed" + +# Don't proceed if there are uninitialized submodules. In particular, +# autogen.sh will remove dangling links, which might be links into +# uninitialized submodules. +# But it's OK if the 'gnulib' submodule is uninitialized, as long as +# GNULIB_SRCDIR is set. +if $use_git; then + # Uninitialized submodules are listed with an initial dash. + uninitialized=`git submodule | grep '^-' | awk '{ print $2 }'` + if test -n "$GNULIB_SRCDIR"; then + uninitialized=`echo "$uninitialized" | grep -v '^gnulib$'` + fi + if test -n "$uninitialized"; then + die "Some git submodules are not initialized: "`echo "$uninitialized" | tr '\n' ',' | sed -e 's|,$|.|'`" Either use option '--no-git', or run 'git submodule update --init' and bootstrap again." + fi +fi + +echo "$0: done. Now you can run './autogen.sh'." + +# ---------------------------------------------------------------------------- + +# Local Variables: +# eval: (add-hook 'before-save-hook 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC0" +# time-stamp-end: "; # UTC" +# End: -- cgit v1.2.1