Revision
72998
Author
jmr@macports.org
Date
2010-10-31 13:40:24 -0700 (Sun, 31 Oct 2010)

Log Message

merge r72997 from trunk:
 in mportexec, in addition to checking if the target potentially requires dependencies, check if the port actually has any dependencies relevant to the target

Modified Paths

Diff

Modified: branches/release_1_9/base/src/macports1.0/macports.tcl (72997 => 72998)


--- branches/release_1_9/base/src/macports1.0/macports.tcl	2010-10-31 20:36:52 UTC (rev 72997)
+++ branches/release_1_9/base/src/macports1.0/macports.tcl	2010-10-31 20:40:24 UTC (rev 72998)
@@ -1565,7 +1565,7 @@
 
     # Before we build the port, we must build its dependencies.
     set dlist {}
-    if {[macports::_target_needs_deps $target]} {
+    if {[macports::_target_needs_deps $target] && [macports::_mport_has_deptypes $mport [macports::_deptypes_for_target $target $workername]]} {
         registry::exclusive_lock
         # possibly warn or error out depending on how old xcode is
         if {[$workername eval _check_xcode_version] != 0} {
@@ -2603,6 +2603,17 @@
     ui_error "and does not have a universal variant."
 }
 
+# check if the given mport has any dependencies of the given types
+proc macports::_mport_has_deptypes {mport deptypes} {
+    array set portinfo [mportinfo $mport]
+    foreach type $deptypes {
+        if {[info exists portinfo($type)] && $portinfo($type) != ""} {
+            return 1
+        }
+    }
+    return 0
+}
+
 # check if the given target needs dependencies installed first
 proc macports::_target_needs_deps {target} {
     # XXX: need a better way than checking this hardcoded list