X-Git-Url: https://erislabs.net/gitweb/?a=blobdiff_plain;f=build-aux%2Fbootstrap;h=74fa3eb12a20f0c5a0c3d008799f9c0633672493;hb=af6914c5f20f09c491bf9e360d5544f912d03602;hp=87a279821bee2a0d5b90b46580f6a223df498ddd;hpb=3a655908ea57ba3846005e7ba333b107a6bd6281;p=gnulib.git diff --git a/build-aux/bootstrap b/build-aux/bootstrap index 87a279821..74fa3eb12 100755 --- a/build-aux/bootstrap +++ b/build-aux/bootstrap @@ -165,7 +165,7 @@ do usage exit;; --gnulib-srcdir=*) - GNULIB_SRCDIR=`expr "$option" : '--gnulib-srcdir=\(.*\)'`;; + GNULIB_SRCDIR=`expr "X$option" : 'X--gnulib-srcdir=\(.*\)'`;; --skip-po) SKIP_PO=t;; --force) @@ -273,11 +273,12 @@ update_po_files() { langs=`cd $ref_po_dir && echo *.po|sed 's/\.po//g'` test "$langs" = '*' && langs=x - for po in `cd $ref_po_dir && echo *.po|sed 's/\.po//g'`; do + 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 --status "$cksum_file" < "$new_po" > /dev/null; then echo "updated $po_dir/$po.po..." cp "$new_po" "$po_dir/$po.po" && sha1sum < "$new_po" > "$cksum_file" @@ -382,9 +383,13 @@ cp_mark_as_generated() if test -z "$c1"; then cmp -s "$cp_src" "$cp_dst" || { + # Copy the file first to get proper permissions if it + # doesn't already exist. Then overwrite the copy. echo "$0: cp -f $cp_src $cp_dst" && rm -f "$cp_dst" && - sed "s!$bt_regex/!!g" "$cp_src" > "$cp_dst" + cp "$cp_src" "$cp_dst-t" && + sed "s!$bt_regex/!!g" "$cp_src" > "$cp_dst-t" && + mv -f "$cp_dst-t" "$cp_dst" } else # Copy the file first to get proper permissions if it @@ -414,6 +419,8 @@ version_controlled_file() { grep '^/[^/]*/[0-9]' > /dev/null && found=yes elif test -d .git; then git rm -n "$dir/$file" > /dev/null 2>&1 && found=yes + elif test -d .svn; then + svn log -r HEAD "$dir/$file" > /dev/null 2>&1 && found=yes else echo "$0: no version control for $dir/$file?" >&2 fi @@ -522,28 +529,20 @@ if test $with_gettext = yes; then cp configure.ac $bt2 && (cd $bt2 && autopoint && rm configure.ac) && slurp $bt2 $bt || exit - - rm -fr $bt $bt2 || exit -fi - -# Coreutils is unusual in that it generates some of its test-related -# Makefile.am files. That must be done before invoking automake. -mam_template=tests/Makefile.am.in -if test -f $mam_template; then - PERL=perl - for tool in cut head join pr sort tac tail test tr uniq wc; do - m=tests/$tool/Makefile.am - t=${m}t - rm -f $m $t - sed -n '1,/^##test-files-begin/p' $mam_template > $t - echo "x = $tool" >> $t - srcdir=tests/$tool - $PERL -I$srcdir -w -- tests/mk-script $srcdir --list >> $t - sed -n '/^##test-files-end/,$p' $mam_template >> $t - chmod -w $t - mv $t $m - done fi +rm -fr $bt $bt2 || exit + +# Remove any dangling symlink matching "*.m4" or "*.[ch]" in some +# gnulib-populated directories. Such .m4 files would cause aclocal to fail. +# The following requires GNU find 4.2.3 or newer. Considering the usual +# portability constraints of this script, that may seem a very demanding +# requirement, but it should be ok. Ignore any failure, which is fine, +# since this is only a convenience to help developers avoid the relatively +# unusual case in which a symlinked-to .m4 file is git-removed from gnulib +# between successive runs of this script. +find "$m4_base" "$source_base" \ + -depth \( -name '*.m4' -o -name '*.[ch]' \) \ + -type l -xtype l -delete > /dev/null 2>&1 # Reconfigure, getting other files.