[36735] trunk/base/src/macports1.0/macports.tcl
jmr at macports.org
jmr at macports.org
Tue May 13 06:43:24 PDT 2008
Revision: 36735
http://trac.macosforge.org/projects/macports/changeset/36735
Author: jmr at macports.org
Date: 2008-05-13 06:43:23 -0700 (Tue, 13 May 2008)
Log Message:
-----------
In image mode, don't count dependencies as being satisfied when the satisfying
port is not active. Fix for #7361.
Modified Paths:
--------------
trunk/base/src/macports1.0/macports.tcl
Modified: trunk/base/src/macports1.0/macports.tcl
===================================================================
--- trunk/base/src/macports1.0/macports.tcl 2008-05-13 13:41:48 UTC (rev 36734)
+++ trunk/base/src/macports1.0/macports.tcl 2008-05-13 13:43:23 UTC (rev 36735)
@@ -1134,21 +1134,30 @@
}
}
+# Determine if a port is active (only for image mode)
+proc _mportactive {mport} {
+ set workername [ditem_key $mport workername]
+ if {[catch {set reslist [$workername eval registry_active \${portname}]} res]} {
+ return 0
+ } else {
+ return [expr [llength $reslist] > 0]
+ }
+}
+
### _mportispresent is private; may change without notice
-# Determine if some depspec is satisfied or if the given port is installed.
+# Determine if some depspec is satisfied or if the given port is installed
+# (and active, if we're in image mode).
# We actually start with the registry (faster?)
#
# mport the port to test (to figure out if it's present)
# depspec the dependency test specification (path, bin, lib, etc.)
proc _mportispresent {mport depspec} {
- # Check for the presense of the port in the registry
- set workername [ditem_key $mport workername]
ui_debug "Searching for dependency: [ditem_key $mport provides]"
- if {[catch {set reslist [$workername eval registry_installed \${portname}]} res]} {
- set res 0
+ if {[string equal ${macports::registry.installtype} "image"]} {
+ set res [_mportactive $mport]
} else {
- set res [llength $reslist]
+ set res [_mportinstalled $mport]
}
if {$res != 0} {
ui_debug "Found Dependency: receipt exists for [ditem_key $mport provides]"
@@ -1237,7 +1246,7 @@
# xxx: as with below, this is ugly. and deps need to be fixed to
# understand Port Images before this can get prettier
if { [string equal ${macports::registry.installtype} "image"] } {
- set result [dlist_eval $dlist _mportinstalled [list _mportexec "activate"]]
+ set result [dlist_eval $dlist _mportactive [list _mportexec "activate"]]
} else {
set result [dlist_eval $dlist _mportinstalled [list _mportexec "install"]]
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macports-changes/attachments/20080513/1e8399c2/attachment.html
More information about the macports-changes
mailing list