From: Jim Meyering Date: Fri, 29 Aug 2008 10:53:50 +0000 (+0200) Subject: bootstrap: merge changes from coreutils X-Git-Tag: v0.1~7110 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=2477d329d432a5969750486f2ea7657f5c54abae;p=gnulib.git bootstrap: merge changes from coreutils * build-aux/bootstrap (cp_mark_as_generated): Preserve perms of copied files. Remove a kludge, now that this is fixed. * build-aux/bootstrap: Fix unportable expr usage. (by Ralf Wildenhues) * build-aux/bootstrap: Remove $bt and $bt2 also when not using gettext. * build-aux/bootstrap: Remove coreutils-specific SUBDIRS-related code. --- diff --git a/ChangeLog b/ChangeLog index 070104125..35260b775 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-08-29 Jim Meyering + + bootstrap: merge changes from coreutils + * build-aux/bootstrap (cp_mark_as_generated): Preserve perms + of copied files. Remove a kludge, now that this is fixed. + * build-aux/bootstrap: Fix unportable expr usage. (by Ralf Wildenhues) + * build-aux/bootstrap: Remove $bt and $bt2 also when not using gettext. + * build-aux/bootstrap: Remove coreutils-specific SUBDIRS-related code. + 2008-08-29 Bruno Haible * MODULES.html.sh: Remove --cvs-urls option. diff --git a/build-aux/bootstrap b/build-aux/bootstrap index 5295ecc84..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) @@ -383,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 @@ -525,28 +529,8 @@ 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.