Changeset 79444
- Timestamp:
- 06/13/11 08:18:38 (4 years ago)
- File:
-
- 1 edited
-
trunk/base/src/images_to_archives.tcl (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/base/src/images_to_archives.tcl
r78144 r79444 80 80 set targetdir [file join ${macports::registry.path} software ${iname}] 81 81 file mkdir $targetdir 82 if {${macports::registry.format} == "receipt_sqlite"} { 83 set contents [$iref imagefiles] 84 } else { 85 set contents {} 86 set rawcontents [registry::property_retrieve $iref contents] 87 foreach entry $rawcontents { 88 lappend contents [lindex $entry 0] 89 } 90 } 82 set contents [$iref imagefiles] 91 83 } 92 84 set newlocation [file join $targetdir $archivename] … … 112 104 if {$installtype == "direct"} { 113 105 # change receipt to image 114 if {${macports::registry.format} == "receipt_sqlite"} { 115 $iref installtype image 116 $iref state imaged 117 $iref activate [$iref imagefiles] 118 $iref state installed 119 } else { 120 registry::property_store $iref installtype image 121 foreach entry $contents { 122 registry::register_file $entry $iname 123 } 124 registry::property_store $iref active 1 125 } 106 $iref installtype image 107 $iref state imaged 108 $iref activate [$iref imagefiles] 109 $iref state installed 126 110 } 127 111 128 if {${macports::registry.format} == "flat" && $installtype == "image"} {129 # flat receipts also need file paths in contents trimmed to exclude image dir130 set loclen [string length $location]131 set locend [expr $loclen - 1]132 set oldcontents [registry::property_retrieve $iref contents]133 set newcontents {}134 foreach fe $contents {135 set oldfilepath [lindex $fe 0]136 if {[string range $oldfilepath 0 $locend] == $location} {137 set newfilepath [string range $oldfilepath $loclen end]138 set newentry [list $newfilepath]139 foreach other [lrange $fe 1 end] {140 lappend newentry $other141 }142 lappend newcontents $newentry143 } else {144 lappend newcontents $fe145 }146 }147 registry::property_store $iref contents $newcontents148 }149 112 # set the new location in the registry and delete the old dir 150 113 registry::property_store $iref location $newlocation 151 if {${macports::registry.format} == "flat"} {152 registry::write_entry $iref153 }154 114 if {$location != "" && [file isdirectory $location]} { 155 115 file delete -force $location
Note: See TracChangeset
for help on using the changeset viewer.

