[prev in list] [next in list] [prev in thread] [next in thread] 

List:       coreutils-bug
Subject:    Re: broken symlinks after updating from gnulib
From:       Bruno Haible <bruno () clisp ! org>
Date:       2007-08-26 10:36:17
Message-ID: 200708261236.17772.bruno () clisp ! org
[Download RAW message or body]

Eric Blake wrote:
> For findutils, I recently added a patch to the import-gnulib.sh script to
> call 'find -L -lname '*' -delete' after the fact (yes, this is GNU find
> specific, but does the job of deleting all broken symlinks).  But it would
> be better if gnulib-tool and bootstrap were taught to do this instead.

This should fix it for gnulib-tool. (Untested.)


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.

--- gnulib-tool 26 Aug 2007 10:31:22 -0000      1.253
+++ gnulib-tool 26 Aug 2007 10:34:26 -0000
@@ -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"


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic