- # Update the .cvsignore and .gitignore files.
- { echo "$added_files" | sed -e '/^$/d' -e 's,\([^/]*\)$,|A|\1,'
- echo "$removed_files" | sed -e '/^$/d' -e 's,\([^/]*\)$,|R|\1,'
- } | LC_ALL=C sort -t'|' -k1,1 > "$tmp"/fileset-changes
- { # Rearrange file descriptors. Needed because "while ... done < ..."
- # constructs are executed in a subshell e.g. by Solaris 10 /bin/sh.
- exec 5<&0 < "$tmp"/fileset-changes
- func_update_ignorelist ()
- {
- ignore="$1"
- if test -f "$destdir/$dir$ignore"; then
- if test -n "$dir_added" || test -n "$dir_removed"; then
- LC_ALL=C sort "$destdir/$dir$ignore" > "$tmp"/ignore
- echo "$dir_added" | sed -e '/^$/d' | LC_ALL=C sort -u \
- | LC_ALL=C join -v 2 "$tmp"/ignore - > "$tmp"/ignore-added
- echo "$dir_removed" | sed -e '/^$/d' | LC_ALL=C sort -u \
- | LC_ALL=C join -v 2 "$tmp"/ignore - > "$tmp"/ignore-removed
- if test -s "$tmp"/ignore-added || test -s "$tmp"/ignore-removed; then
+ if test "$vc_files" != false; then
+ # Update the .cvsignore and .gitignore files.
+ { echo "$added_files" | sed -e '/^$/d' -e 's,\([^/]*\)$,|A|\1,'
+ echo "$removed_files" | sed -e '/^$/d' -e 's,\([^/]*\)$,|R|\1,'
+ # Treat gnulib-comp.m4 like an added file, even if it already existed.
+ echo "$m4base/|A|gnulib-comp.m4"
+ } | LC_ALL=C sort -t'|' -k1,1 > "$tmp"/fileset-changes
+ { # Rearrange file descriptors. Needed because "while ... done < ..."
+ # constructs are executed in a subshell e.g. by Solaris 10 /bin/sh.
+ exec 5<&0 < "$tmp"/fileset-changes
+ func_update_ignorelist ()
+ {
+ ignore="$1"
+ if test -f "$destdir/$dir$ignore"; then
+ if test -n "$dir_added" || test -n "$dir_removed"; then
+ LC_ALL=C sort "$destdir/$dir$ignore" > "$tmp"/ignore
+ echo "$dir_added" | sed -e '/^$/d' | LC_ALL=C sort -u \
+ | LC_ALL=C join -v 2 "$tmp"/ignore - > "$tmp"/ignore-added
+ echo "$dir_removed" | sed -e '/^$/d' | LC_ALL=C sort -u \
+ | LC_ALL=C join -v 2 "$tmp"/ignore - > "$tmp"/ignore-removed
+ if test -s "$tmp"/ignore-added || test -s "$tmp"/ignore-removed; then
+ if $doit; then
+ echo "Updating $destdir/$dir$ignore (backup in $destdir/$dir${ignore}~)"
+ mv -f "$destdir/$dir$ignore" "$destdir/$dir$ignore"~
+ sed -e 's,^,/^,' -e 's,$,\$/d,' < "$tmp"/ignore-removed > "$tmp"/sed-ignore-removed
+ cat "$destdir/$dir$ignore"~ "$tmp"/ignore-added \
+ | sed -f "$tmp"/sed-ignore-removed \
+ > "$destdir/$dir$ignore"
+ else
+ echo "Update $destdir/$dir$ignore (backup in $destdir/$dir${ignore}~)"
+ fi
+ fi
+ fi
+ else
+ if test -n "$dir_added"; then