From d098c5df93b98908ab73e1aaf2a0c77da7d4fe5d Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 26 Aug 2007 10:36:54 +0000 Subject: [PATCH] Care about dangling symbolic links. --- ChangeLog | 6 ++++++ gnulib-tool | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index cba7b6cdba..82b2a848bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2007-08-26 Bruno Haible + + * gnulib-tool (func_import): When deciding which files to remove, + consider also dangling symbolic links. + Reported by Eric Blake. + 2007-08-26 Bruno Haible * gnulib-tool (func_ln_if_changed): Use "test -h", not "test -L". diff --git a/gnulib-tool b/gnulib-tool index 1108ce0949..2ea257dba6 100755 --- a/gnulib-tool +++ b/gnulib-tool @@ -22,7 +22,7 @@ progname=$0 package=gnulib -cvsdatestamp='$Date: 2007-08-26 10:31:22 $' +cvsdatestamp='$Date: 2007-08-26 10:36:54 $' last_checkin_date=`echo "$cvsdatestamp" | sed -e 's,^\$[D]ate: ,,'` version=`echo "$last_checkin_date" | sed -e 's/ .*$//' -e 's,/,-,g'` nl=' @@ -2230,7 +2230,7 @@ func_import () sed_take_first_column='s,'"$delimiter"'.*,,' for g in `LC_ALL=C join -t"$delimiter" -v1 "$tmp"/old-files "$tmp"/new-files | sed -e "$sed_take_first_column"`; do # Remove the file. Do nothing if the user already removed it. - if test -f "$destdir/$g"; then + if test -f "$destdir/$g" || test -h "$destdir/$g"; then if $doit; then echo "Removing file $g (backup in ${g}~)" mv -f "$destdir/$g" "$destdir/${g}~" || func_fatal_error "failed" -- 2.30.2