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

jmr at macports.org jmr at macports.org
Tue Jun 15 14:14:07 PDT 2010


Revision: 68851
          http://trac.macports.org/changeset/68851
Author:   jmr at macports.org
Date:     2010-06-15 14:14:05 -0700 (Tue, 15 Jun 2010)
Log Message:
-----------
don't put directories in the rollback_filelist

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

Modified: trunk/base/src/registry2.0/portimage.tcl
===================================================================
--- trunk/base/src/registry2.0/portimage.tcl	2010-06-15 20:43:17 UTC (rev 68850)
+++ trunk/base/src/registry2.0/portimage.tcl	2010-06-15 21:14:05 UTC (rev 68851)
@@ -381,11 +381,13 @@
 ##
 ## @param [in] srcfile path to file in image
 ## @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] {
         link {
             ui_debug "activating link: $dstfile"
             file copy -force -- $srcfile $dstfile
+            return 1
         }
         directory {
             # Don't recursively copy directories
@@ -398,6 +400,7 @@
                 # set mtime on installed element
                 file mtime $dstfile [file mtime $srcfile]
             }
+            return 0
         }
         default {
             ui_debug "activating file: $dstfile"
@@ -406,6 +409,7 @@
                 ui_debug "hardlinking $srcfile to $dstfile failed, symlinking instead"
                 file link -symbolic $dstfile $srcfile
             }
+            return 1
         }
     }
 }
@@ -528,8 +532,9 @@
                 try {
                     $port activate $imagefiles
                     foreach file $theList {
-                        _activate_file "${imagedir}${file}" $file
-                        lappend rollback_filelist $file
+                        if {[_activate_file "${imagedir}${file}" $file] == 1} {
+                            lappend rollback_filelist $file
+                        }
                     }
                 } catch {*} {
                     ui_debug "Activation failed, rolling back."
@@ -638,8 +643,9 @@
 
         # Activate it, and catch errors so we can roll-back
         if { [catch { foreach file $theList {
-                        _activate_file "${imagedir}${file}" $file
-                        lappend rollback_filelist $file
+                        if {[_activate_file "${imagedir}${file}" $file] == 1} {
+                            lappend rollback_filelist $file
+                        }
                     }} result]} {
             ui_debug "Activation failed, rolling back."
             _deactivate_contents $name $rollback_filelist yes yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100615/10a033e1/attachment.html>


More information about the macports-changes mailing list