summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2006-09-08 06:52:24 +0000
committerJim Meyering <jim@meyering.net>2006-09-08 06:52:24 +0000
commitaf2c5a4ab0cdec88a65c35b4ad2fa1eb935a93e1 (patch)
treedcbd46fa6cf4f563e60691fea7104fe86236e3aa
parenta3ebb3f3d1179e115b913aa2df576103c53e1197 (diff)
downloadcoreutils-af2c5a4ab0cdec88a65c35b4ad2fa1eb935a93e1.tar.xz
* 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.
-rw-r--r--ChangeLog7
-rwxr-xr-xbootstrap30
2 files changed, 36 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 9624c8eab..4d1e68494 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+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
diff --git a/bootstrap b/bootstrap
index 7afc71fc9..b7f13ca3c 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/