summaryrefslogtreecommitdiff
path: root/bootstrap
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2007-01-15 11:31:51 +0100
committerJim Meyering <jim@meyering.net>2007-01-15 11:31:51 +0100
commitd1ad73e0bf6a1b6c62e424c1f28cf344fca10600 (patch)
tree942730833ee638c6f768e25672da6e5db2f262ac /bootstrap
parent1e23a1785a26137d0e35fc9901e0840f6fbc57f9 (diff)
downloadcoreutils-d1ad73e0bf6a1b6c62e424c1f28cf344fca10600.tar.xz
* bootstrap (gnulib_tool): When adding to .cvsignore and .gitignore,
emit foo.h, for each foo_.h. This yields one false-positive, fts.h, but that's ok, since fts_.h will eventually be renamed.
Diffstat (limited to 'bootstrap')
-rwxr-xr-xbootstrap20
1 files changed, 17 insertions, 3 deletions
diff --git a/bootstrap b/bootstrap
index a5065aaa4..28fb9ef15 100755
--- a/bootstrap
+++ b/bootstrap
@@ -2,7 +2,7 @@
# Bootstrap this package from CVS.
-# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# Copyright (C) 2003, 2004, 2005, 2006, 2007 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -350,6 +350,16 @@ version_controlled_file() {
test $found = yes
}
+# If $STR is not already on a line by itself in $FILE, insert it,
+# sorting the new contents of the file and replacing $FILE with the result.
+insert_sorted_if_absent() {
+ file=$1
+ str=$2
+ echo "$str" | sort -u - $file | cmp -s - $file \
+ || echo "$str" | sort -u - $file -o $file \
+ || exit
+}
+
slurp() {
for dir in . `(cd $1 && find * -type d -print)`; do
copied=
@@ -392,8 +402,12 @@ slurp() {
for dot_ig in .cvsignore .gitignore; do
ig=$dir/$dot_ig
if test -n "$copied" && test -f $ig; then
- echo "$copied" | sort -u - $ig | cmp -s - $ig ||
- echo "$copied" | sort -u - $ig -o $ig || exit
+ insert_sorted_if_absent $ig "$copied"
+ # If an ignored file name ends with _.h, then also add
+ # the name with just ".h". Many gnulib headers are generated,
+ # e.g., stdint_.h -> stdint.h, dirent_.h ->..., etc.
+ f=`echo "$copied"|sed 's/_\.h$/.h/'`
+ insert_sorted_if_absent $ig "$f"
fi
done
done