Changeset 79445
- Timestamp:
- 06/13/11 08:53:43 (4 years ago)
- File:
-
- 1 edited
-
trunk/base/src/images_to_archives.tcl (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/base/src/images_to_archives.tcl
r79444 r79445 9 9 package require macports 1.0 10 10 package require registry 1.0 11 package require registry2 2.0 12 package require Pextlib 1.0 13 14 umask 022 11 15 12 16 mportinit … … 24 28 25 29 puts "This could take a while..." 30 31 # list of ports we successfully create an archive of, to be used to update 32 # the registry only after we know all creation attempts were successful. 33 set archived_list {} 26 34 27 35 foreach installed $ilist { … … 102 110 } 103 111 112 lappend archived_list [list $installtype $iref $location $newlocation] 113 } 114 } 115 116 registry::write { 117 foreach archived $archived_list { 118 set installtype [lindex $archived 0] 119 set iref [lindex $archived 1] 120 set newlocation [lindex $archived 3] 121 104 122 if {$installtype == "direct"} { 105 123 # change receipt to image … … 109 127 $iref state installed 110 128 } 129 130 # set the new location in the registry and delete the old dir 131 $iref location $newlocation 132 } 133 } 111 134 112 # set the new location in the registry and delete the old dir 113 registry::property_store $iref location $newlocation 114 if {$location != "" && [file isdirectory $location]} { 115 file delete -force $location 135 foreach archived $archived_list { 136 set location [lindex $archived 2] 137 if {$location != "" && [file isdirectory $location]} { 138 if {[catch {file delete -force $location} result]} { 139 ui_warn "Failed to delete ${location}: $result" 116 140 } 117 141 }
Note: See TracChangeset
for help on using the changeset viewer.

