[59318] trunk/base/src/registry1.0/portuninstall.tcl
jmr at macports.org
jmr at macports.org
Tue Oct 13 07:01:41 PDT 2009
Revision: 59318
http://trac.macports.org/changeset/59318
Author: jmr at macports.org
Date: 2009-10-13 07:01:39 -0700 (Tue, 13 Oct 2009)
Log Message:
-----------
avoid calling realpath for nonexistent files (#22001)
Modified Paths:
--------------
trunk/base/src/registry1.0/portuninstall.tcl
Modified: trunk/base/src/registry1.0/portuninstall.tcl
===================================================================
--- trunk/base/src/registry1.0/portuninstall.tcl 2009-10-13 14:00:03 UTC (rev 59317)
+++ trunk/base/src/registry1.0/portuninstall.tcl 2009-10-13 14:01:39 UTC (rev 59318)
@@ -188,18 +188,21 @@
}
}
}
- # Normalize the file path to avoid removing the intermediate
- # symlinks (remove the empty directories instead)
- set theFile [file normalize [lindex $f 0]]
- lappend files $theFile
+
+ if { [file exists $f] || (![catch {file type $f}] && [file type $f] == "link") } {
+ # Normalize the file path to avoid removing the intermediate
+ # symlinks (remove the empty directories instead)
+ set theFile [file normalize [lindex $f 0]]
+ lappend files $theFile
- # Split out the filename's subpaths and add them to the
- # list as well. The realpath call is necessary because file normalize
- # does not resolve symlinks on OS X < 10.6
- set directory [realpath [file dirname $theFile]]
- while { [lsearch -exact $files $directory] == -1 } {
- lappend files $directory
- set directory [file dirname $directory]
+ # Split out the filename's subpaths and add them to the
+ # list as well. The realpath call is necessary because file normalize
+ # does not resolve symlinks on OS X < 10.6
+ set directory [realpath [file dirname $theFile]]
+ while { [lsearch -exact $files $directory] == -1 } {
+ lappend files $directory
+ set directory [file dirname $directory]
+ }
}
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20091013/b686a215/attachment.html>
More information about the macports-changes
mailing list