changeset 9168:9b8032e2af0c

Care about dangling symbolic links.
author Bruno Haible <bruno@clisp.org>
date Sun, 26 Aug 2007 10:36:54 +0000
parents a459223799e0
children dfa92826de1e
files ChangeLog gnulib-tool
diffstat 2 files changed, 8 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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".
--- 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 @@
   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"