From af2c5a4ab0cdec88a65c35b4ad2fa1eb935a93e1 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 8 Sep 2006 06:52:24 +0000 Subject: [PATCH] * bootstrap (cp_mark_as_generated): New function. (slurp): Use it to prepend editor hints and a warning that the file we're copying is generated. Suggestion from Bruce Korb. --- ChangeLog | 7 +++++++ bootstrap | 30 +++++++++++++++++++++++++++++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9624c8e..4d1e684 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-09-08 Jim Meyering + + * bootstrap (cp_mark_as_generated): New function. + (slurp): Use it to prepend editor hints and a warning that + the file we're copying is generated. + Suggestion from Bruce Korb. + 2006-09-07 Jim Meyering * bootstrap: Revert last change. There are less disruptive ways diff --git a/bootstrap b/bootstrap index 7afc71f..b7f13ca 100755 --- a/bootstrap +++ b/bootstrap @@ -212,6 +212,29 @@ case $SKIP_PO in fi;; esac +cp_mark_as_generated() +{ + local src=$1 + local dst=$2 + local c1 c2 + case $dst in + *.[chly]) c1='/* '; c2=' */';; + *.texi) c1='@c '; c2= ;; + *.m4|*/Make*|Make*) c1='# '; c2= ;; + *) ;; + esac + + if test -z "$c1"; then + cp "$src" "$dst" + return + fi + + ( + echo "$c1-*- buffer-read-only: t -*- vi: set ro:$c2" + echo "$c1DO NOT EDIT! GENERATED AUTOMATICALLY!$c2" + cat "$src" + ) >> "$dst" +} slurp() { for dir in . `(cd $1 && find * -type d -print)`; do @@ -225,6 +248,7 @@ slurp() { if test $file = Makefile.am; then copied=$copied${sep}gnulib.mk; sep=$nl echo "$0: Copying $1/$dir/$file to $dir/gnulib.mk ..." && + rm -f $dir/gnulib.mk sed '/^[^#].*\/intl/s/^/#/' $1/$dir/$file >$dir/gnulib.mk elif test -r ${2-no/such/dir}/$dir/$file || grep -F "/$file/" $dir/CVS/Entries 2>/dev/null | @@ -234,6 +258,7 @@ slurp() { copied=$copied$sep$file; sep=$nl if test $file = gettext.m4; then echo "$0: patching m4/gettext.m4 to remove need for intl/* ..." + rm -f $dir/$file sed ' /^AC_DEFUN(\[AM_INTL_SUBDIR],/,/^]/c\ AC_DEFUN([AM_INTL_SUBDIR], [ @@ -243,7 +268,8 @@ slurp() { AC_DEFUN([gl_LOCK_EARLY], []) ' $1/$dir/$file >$dir/$file else - cp $1/$dir/$file $dir/$file + rm -f $dir/$file + cp_mark_as_generated $1/$dir/$file $dir/$file fi fi || exit done @@ -319,6 +345,7 @@ done # Create gettext configuration. echo "$0: Creating po/Makevars from po/Makevars.template ..." +rm -f po/Makevars sed ' /^EXTRA_LOCALE_CATEGORIES *=/s/=.*/= '"$EXTRA_LOCALE_CATEGORIES"'/ /^MSGID_BUGS_ADDRESS *=/s/=.*/= bug-'"$package"'@gnu.org/ @@ -331,6 +358,7 @@ sed ' if test -d runtime-po; then # Likewise for runtime-po/Makevars, except also change a few other parameters. + rm -f runtime-po/Makevars sed ' s/^\(DOMAIN\) *=.*/\1 = '"$package"'-runtime/ s/^\(subdir\) *=.*/\1 = runtime-po/ -- 2.7.4