[81562] trunk/base/src/registry2.0/portimage.tcl

jmr at macports.org jmr at macports.org
Mon Aug 1 20:46:55 PDT 2011


Revision: 81562
          http://trac.macports.org/changeset/81562
Author:   jmr at macports.org
Date:     2011-08-01 20:46:51 -0700 (Mon, 01 Aug 2011)
Log Message:
-----------
avoid erroring due to name-conflicting files from archives when on case-insensitive FS (#30373)

Modified Paths:
--------------
    trunk/base/src/registry2.0/portimage.tcl

Modified: trunk/base/src/registry2.0/portimage.tcl
===================================================================
--- trunk/base/src/registry2.0/portimage.tcl	2011-08-02 02:53:25 UTC (rev 81561)
+++ trunk/base/src/registry2.0/portimage.tcl	2011-08-02 03:46:51 UTC (rev 81562)
@@ -249,7 +249,17 @@
 ## @param [in] dstfile path to activate file to
 ## @return 1 if file needs to be explicitly deleted if we have to roll back, 0 otherwise
 proc _activate_file {srcfile dstfile} {
-    switch [file type $srcfile] {
+    if {[catch {set filetype [file type $srcfile]} result]} {
+        # this can happen if the archive was built on case-sensitive and we're case-insensitive
+        # we know any existing dstfile is ours because we checked for conflicts earlier
+        if {![catch {file type $dstfile}]} {
+            ui_debug "skipping case-conflicting file: $srcfile"
+            return 0
+        } else {
+            error $result
+        }
+    }
+    switch $filetype {
         directory {
             # Don't recursively copy directories
             ui_debug "activating directory: $dstfile"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110801/72e43414/attachment.html>


More information about the macports-changes mailing list