X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/46356ea426a503063c5e382401a7f5487f4e29bd..e0ac9b4bb068c17dacfa6a6b2b4d8157d27bf8ee:/bootstrap diff --git a/bootstrap b/bootstrap index 21f2e0eb..c3ddd267 100755 --- a/bootstrap +++ b/bootstrap @@ -32,7 +32,7 @@ export LC_ALL usage() { echo >&2 "\ Usage: $0 [OPTION]... -Bootstrap this package from the CVS sources. +Bootstrap this package from the checked-out sources. Options: --gnulib-srcdir=DIRNAME Specify the local directory where gnulib @@ -41,7 +41,8 @@ Options: do not want to waste your bandwidth dowloading them again. --copy Copy files instead of creating symbolic links. - --force Bootstrap even if the sources didn't come from CVS. + --force Attempt to bootstrap even if the sources seem + not to have been checked out. --skip-po Do not download po files. --cvs-user=USERNAME Set the CVS username to be used when accessing the gnulib repository. @@ -86,6 +87,7 @@ package=`sed -n "$extract_package_name" configure.ac` || exit # Extra files from gnulib, which override files from other sources. gnulib_extra_files=' + build-aux/announce-gen build-aux/install-sh build-aux/missing build-aux/mdate-sh @@ -109,9 +111,9 @@ XGETTEXT_OPTIONS='\\\ # Files we don't want to import. excluded_files= -# File that should exist with CVS checkout, but not with -# the distributed version. -CVS_only_file=CVS +# File that should exist in the top directory of a checked out hierarchy, +# but not in a distribution tarball. +CVS_only_file=README-cvs # Whether to use copies instead of symlinks. copy=false @@ -146,7 +148,7 @@ do done if test -n "$CVS_only_file" && test ! -r "$CVS_only_file"; then - echo "$0: Bootstrapping from a non-CVS distribution is a bit risky." >&2 + echo "$0: Bootstrapping from a non-checked-out distribution is risky." >&2 exit 1 fi @@ -334,6 +336,21 @@ cp_mark_as_generated() fi } +version_controlled_file() { + dir=$1 + file=$2 + found=no + if test -d CVS; then + grep -F "/$file/" $dir/CVS/Entries 2>/dev/null | + grep '^/[^/]*/[0-9]' > /dev/null && found=yes + elif test -d .git; then + git-rm -n "$dir/$file" > /dev/null 2>&1 && found=yes + else + echo "$0: no version control for $dir/$file?" >&2 + fi + test $found = yes +} + slurp() { for dir in . `(cd $1 && find * -type d -print)`; do copied= @@ -352,8 +369,7 @@ slurp() { sed "$remove_intl" $1/$dir/$file >$dir/gnulib.mk } elif { test "${2+set}" = set && test -r $2/$dir/$file; } || - grep -F "/$file/" $dir/CVS/Entries 2>/dev/null | - grep -q '^/[^/]*/[0-9]'; then + version_controlled_file $dir $file; then echo "$0: $dir/$file overrides $1/$dir/$file" else copied=$copied$sep$file; sep=$nl @@ -374,11 +390,13 @@ slurp() { fi || exit done - ig=$dir/.cvsignore - if test -n "$copied" && test -f $ig; then - echo "$copied" | sort -u - $ig | cmp -s - $ig || - echo "$copied" | sort -u - $ig -o $ig || exit - fi + for dot_ig in .cvsignore .gitignore; do + ig=$dir/$dot_ig + if test -n "$copied" && test -f $ig; then + echo "$copied" | sort -u - $ig | cmp -s - $ig || + echo "$copied" | sort -u - $ig -o $ig || exit + fi + done done } @@ -460,18 +478,13 @@ sed ' ' po/Makevars.template >po/Makevars if test -d runtime-po; then - # Similarly for runtime-po/Makevars, but not quite the same. + # Likewise for runtime-po/Makevars, except also change a few other parameters. rm -f runtime-po/Makevars sed ' - /^DOMAIN *=.*/s/=.*/= '"$package"'-runtime/ - /^subdir *=.*/s/=.*/= runtime-po/ - /^MSGID_BUGS_ADDRESS *=/s/=.*/= bug-'"$package"'@gnu.org/ - /^XGETTEXT_OPTIONS *=/{ - s/$/ \\/ - a\ - '"$XGETTEXT_OPTIONS_RUNTIME"' $${end_of_xgettext_options+} - } - ' runtime-po/Makevars + s/^\(DOMAIN\) *=.*/\1 = '"$package"'-runtime/ + s/^\(subdir\) *=.*/\1 = runtime-po/ + s/^\(XGETTEXT_OPTIONS\) *=.*/\1 = '"$XGETTEXT_OPTIONS_RUNTIME"'/ + ' runtime-po/Makevars # Copy identical files from po to runtime-po. (cd po && cp -p Makefile.in.in *-quot *.header *.sed *.sin ../runtime-po)