+2006-09-08 Jim Meyering <jim@meyering.net>
+
+ * 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 <jim@meyering.net>
* bootstrap: Revert last change. There are less disruptive ways
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
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 |
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], [
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
# 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/
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/