X-Git-Url: https://git.dogcows.com/gitweb?p=chaz%2Ftar;a=blobdiff_plain;f=bootstrap;h=c8b7c57ac25565959ba069336a78e1ec5b8c6a80;hp=2b3f24b32b0e6a5cd4f979d78e6298376d425964;hb=576e99a21c566598d7a701142e439cb283cac24f;hpb=241b72ffadc9128f5fe2d2fc8d9cf3ff5e23f57a diff --git a/bootstrap b/bootstrap index 2b3f24b..c8b7c57 100755 --- a/bootstrap +++ b/bootstrap @@ -1,10 +1,10 @@ #! /bin/sh # Print a version string. -scriptversion=2010-10-08.16; # UTC +scriptversion=2012-12-31.16; # UTC # Bootstrap this package from checked-out sources. -# Copyright (C) 2003-2010 Free Software Foundation, Inc. +# Copyright (C) 2003-2010, 2013-2014 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 @@ -49,6 +49,11 @@ Usage: $0 [OPTION]... Bootstrap this package from the checked-out sources. Options: + --paxutils-srcdir=DIRNAME Specify the local directory where paxutils + sources reside. Use this if you already + have paxutils sources on your machine, and + do not want to waste your bandwidth dowloading + them again. --gnulib-srcdir=DIRNAME Specify the local directory where gnulib sources reside. Use this if you already have gnulib sources on your machine, and @@ -126,7 +131,6 @@ tests_base=tests # Extra files from gnulib, which override files from other sources. gnulib_extra_files=" $build_aux/install-sh - $build_aux/missing $build_aux/mdate-sh $build_aux/texinfo.tex $build_aux/depcomp @@ -233,6 +237,8 @@ do exit;; --gnulib-srcdir=*) GNULIB_SRCDIR=`expr "X$option" : 'X--gnulib-srcdir=\(.*\)'`;; + --paxutils-srcdir=*) + PAXUTILS_SRCDIR=`expr "$option" : '--paxutils-srcdir=\(.*\)'`;; --skip-po) SKIP_PO=t;; --force) @@ -420,20 +426,44 @@ if test -d .git && (git --version) >/dev/null 2>/dev/null ; then fi fi +cleanup() { + status=$? + rm -fr $1 + exit $status +} cleanup_gnulib() { - status=$? - rm -fr "$gnulib_path" - exit $status + cleanup "$gnulib_path" } +# Get paxutils files. +case ${PAXUTILS_SRCDIR--} in +-) if [ ! -d paxutils ]; then + echo "$0: getting paxutils files..." + + trap "cleanup paxutils" 1 2 13 15 + + git clone --depth 1 git://git.sv.gnu.org/paxutils || cleanup paxutils + + trap - 1 2 13 15 + fi + PAXUTILS_SRCDIR=paxutils + ;; +esac + +if [ -r $PAXUTILS_SRCDIR/gnulib.modules ]; then + gnulib_modules=` + (echo "$gnulib_modules"; grep '^[^#]' $PAXUTILS_SRCDIR/gnulib.modules) | + sort -u + ` +fi + git_modules_config () { test -f .gitmodules && git config --file .gitmodules "$@" } gnulib_path=`git_modules_config submodule.gnulib.path` -: ${gnulib_path=gnulib} - +: ${gnulib_path:=gnulib} # Get gnulib files. case ${GNULIB_SRCDIR--} in @@ -591,6 +621,7 @@ symlink_to_dir() /*) ;; *) case /$dst/ in + /./*) ;; *//* | */../* | */./* | /*/*/*/*/*/) echo >&2 "$0: invalid symlink calculation: $src -> $dst" exit 1;; @@ -810,6 +841,51 @@ find "$m4_base" "$source_base" \ # Reconfigure, getting other files. +# copy_files srcdir dstdir +copy_files() { + for file in `cat $1/DISTFILES` + do + case $file in + "#*") continue;; + esac + dst=`echo $file | sed 's^.*/^^'` + if [ $# -eq 3 ]; then + case $dst in + ${3}*) ;; + *) dst=${3}$dst;; + esac + fi + symlink_to_dir "$1" "$file" "$2/$dst" || exit +# FIXME ignorefile $2 $dst + done +} + +# Import from paxutils +copy_files ${PAXUTILS_SRCDIR} . +copy_files ${PAXUTILS_SRCDIR}/am m4 +echo "$0: Creating m4/paxutils.m4" +(echo "# This file is generated automatically. Please, do not edit." + echo "#" + echo "AC_DEFUN([${package}_PAXUTILS],[" + cat ${PAXUTILS_SRCDIR}/am/DISTFILES | sed '/^#/d;s/\(.*\)\.m4/pu_\1/' | tr a-z A-Z + echo "])") > ./m4/paxutils.m4 +#FIXME ignorefile m4 paxutils.m4 + +if [ -d rmt ]; then + : +else + mkdir rmt +fi + +for dir in doc rmt lib tests +do + copy_files ${PAXUTILS_SRCDIR}/$dir $dir +done + +copy_files ${PAXUTILS_SRCDIR}/paxlib lib pax + + + # Skip autoheader if it's not needed. grep -E '^[ ]*AC_CONFIG_HEADERS?\>' configure.ac >/dev/null || AUTOHEADER=true