diff options
author | Jim Meyering <jim@meyering.net> | 2007-08-24 22:40:23 +0200 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2007-08-24 22:42:07 +0200 |
commit | 8f3cb068fc2240b3b0a0fbee6fea6ecf3460966c (patch) | |
tree | 120fbe2f8a041d657be6ec626e2f693abdca6b1d | |
parent | bcc1a1625ceb1d44514e079e97102febb14ce9c1 (diff) | |
download | coreutils-8f3cb068fc2240b3b0a0fbee6fea6ecf3460966c.tar.xz |
Create .gitignore and/or .cvsignore from scratch, if absent.
This is in preparation for my removing those files from version
control in the directories managed by gnulib-tool.
* bootstrap: New setting: vc_ignore.
(insert_sorted_if_absent): Create $file if absent.
Adapt to new, possibly empty, list: $vc_ignore.
-rw-r--r-- | ChangeLog | 7 | ||||
-rwxr-xr-x | bootstrap | 23 |
2 files changed, 26 insertions, 4 deletions
@@ -1,5 +1,12 @@ 2007-08-24 Jim Meyering <jim@meyering.net> + Create .gitignore and/or .cvsignore from scratch, if absent. + This is in preparation for my removing those files from version + control in the directories managed by gnulib-tool. + * bootstrap: New setting: vc_ignore. + (insert_sorted_if_absent): Create $file if absent. + Adapt to new, possibly empty, list: $vc_ignore. + * src/system.h (fseeko, ftello): Remove now-unneeded definitions. * src/od.c (LDBL_DIG): Remove now-unneeded definition. @@ -129,9 +129,21 @@ checkout_only_file=README-hacking # Whether to use copies instead of symlinks. copy=false +# Set this to '.cvsignore .gitignore' in bootstrap.conf if you want +# those files to be generated in directories like lib/, m4/, and po/. +# Or set it to 'auto' to make this script select which to use based +# on which version control system (if any) is used in the source directory. +vc_ignore=auto + # Override the default configuration, if necessary. test -r bootstrap.conf && . ./bootstrap.conf +if test "$vc_ignore" = auto; then + vc_ignore= + test -d .git && vc_ignore=.gitignore + test -d CVS && vc_ignore="$vc_ignore .cvsignore" +fi + # Translate configuration into internal form. # Parse options. @@ -168,6 +180,7 @@ fi insert_sorted_if_absent() { file=$1 str=$2 + test -f $file || touch $file echo "$str" | sort -u - $file | cmp -s - $file \ || echo "$str" | sort -u - $file -o $file \ || exit 1 @@ -189,8 +202,9 @@ fi # below will malfunction. If creating it, also mark it as ignored. if test ! -d $build_aux; then mkdir $build_aux - for ig in .cvsignore .gitignore; do - test -f $ig && insert_sorted_if_absent $ig $build_aux + for dot_ig in x $vc_ignore; do + test $dot_ig = x && continue + insert_sorted_if_absent $dot_ig $build_aux done fi @@ -428,9 +442,10 @@ slurp() { fi || exit done - for dot_ig in .cvsignore .gitignore; do + for dot_ig in x $vc_ignore; do + test $dot_ig = x && continue ig=$dir/$dot_ig - if test -n "$copied" && test -f $ig; then + if test -n "$copied"; then 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, |