Ticket #7361: _mportispresent.diff
File _mportispresent.diff, 2.1 KB (added by jmroot (Joshua Root), 17 years ago) |
---|
-
src/macports1.0/macports.tcl
1134 1134 } 1135 1135 } 1136 1136 1137 # Determine if a port is active (only for image mode) 1138 proc _mportactive {mport} { 1139 set workername [ditem_key $mport workername] 1140 if {[catch {set reslist [$workername eval registry_active \${portname}]} res]} { 1141 return 0 1142 } else { 1143 return [expr [llength $reslist] > 0] 1144 } 1145 } 1146 1137 1147 ### _mportispresent is private; may change without notice 1138 1148 1139 # Determine if some depspec is satisfied or if the given port is installed. 1149 # Determine if some depspec is satisfied or if the given port is installed 1150 # (and active, if we're in image mode). 1140 1151 # We actually start with the registry (faster?) 1141 1152 # 1142 1153 # mport the port to test (to figure out if it's present) 1143 1154 # depspec the dependency test specification (path, bin, lib, etc.) 1144 1155 proc _mportispresent {mport depspec} { 1145 # Check for the presense of the port in the registry1146 set workername [ditem_key $mport workername]1147 1156 ui_debug "Searching for dependency: [ditem_key $mport provides]" 1148 if {[ catch {set reslist [$workername eval registry_installed \${portname}]} res]} {1149 set res 01157 if {[string equal ${macports::registry.installtype} "image"]} { 1158 set res [_mportactive $mport] 1150 1159 } else { 1151 set res [ llength $reslist]1160 set res [_mportinstalled $mport] 1152 1161 } 1153 1162 if {$res != 0} { 1154 1163 ui_debug "Found Dependency: receipt exists for [ditem_key $mport provides]" … … 1237 1246 # xxx: as with below, this is ugly. and deps need to be fixed to 1238 1247 # understand Port Images before this can get prettier 1239 1248 if { [string equal ${macports::registry.installtype} "image"] } { 1240 set result [dlist_eval $dlist _mport installed[list _mportexec "activate"]]1249 set result [dlist_eval $dlist _mportactive [list _mportexec "activate"]] 1241 1250 } else { 1242 1251 set result [dlist_eval $dlist _mportinstalled [list _mportexec "install"]] 1243 1252 }