Care about dangling symbolic links.
authorBruno Haible <bruno@clisp.org>
Sun, 26 Aug 2007 10:36:54 +0000 (10:36 +0000)
committerBruno Haible <bruno@clisp.org>
Sun, 26 Aug 2007 10:36:54 +0000 (10:36 +0000)
ChangeLog
gnulib-tool

index cba7b6cdba754c570a458854550db792dc9dcb4d..82b2a848bce9ee3aee3d920628b144fb6f138d72 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2007-08-26  Bruno Haible  <bruno@clisp.org>
+
+       * gnulib-tool (func_import): When deciding which files to remove,
+       consider also dangling symbolic links.
+       Reported by Eric Blake.
+
 2007-08-26  Bruno Haible  <bruno@clisp.org>
 
        * gnulib-tool (func_ln_if_changed): Use "test -h", not "test -L".
index 1108ce0949f7474c51952ae76fc6f272fae6e6e8..2ea257dba6093b6eac97cdffcf7412ce2e766698 100755 (executable)
@@ -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"