[68806] trunk/base/src/macports1.0/macports.tcl

jmr at macports.org jmr at macports.org
Mon Jun 14 02:32:55 PDT 2010


Revision: 68806
          http://trac.macports.org/changeset/68806
Author:   jmr at macports.org
Date:     2010-06-14 02:32:50 -0700 (Mon, 14 Jun 2010)
Log Message:
-----------
add activate to list of targets that need deps installed (#25239), factor out check into a helper proc

Modified Paths:
--------------
    trunk/base/src/macports1.0/macports.tcl

Modified: trunk/base/src/macports1.0/macports.tcl
===================================================================
--- trunk/base/src/macports1.0/macports.tcl	2010-06-14 08:15:00 UTC (rev 68805)
+++ trunk/base/src/macports1.0/macports.tcl	2010-06-14 09:32:50 UTC (rev 68806)
@@ -1560,18 +1560,8 @@
     }
 
     # Before we build the port, we must build its dependencies.
-    # XXX: need a more general way of comparing against targets
     set dlist {}
-    if {   $target == "fetch" || $target == "checksum"
-        || $target == "extract" || $target == "patch"
-        || $target == "configure" || $target == "build"
-        || $target == "test"
-        || $target == "destroot" || $target == "install"
-        || $target == "archive"
-        || $target == "dmg" || $target == "mdmg"
-        || $target == "pkg" || $target == "mpkg"
-        || $target == "rpm" || $target == "dpkg"
-        || $target == "srpm"|| $target == "portpkg" } {
+    if {[macports::_target_needs_deps $target]} {
 
         # possibly warn or error out depending on how old xcode is
         if {[$workername eval _check_xcode_version] != 0} {
@@ -2615,6 +2605,33 @@
     ui_error "and does not have a universal variant."
 }
 
+# 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
+    switch -- $target {
+        fetch -
+        checksum -
+        extract -
+        patch -
+        configure -
+        build -
+        test -
+        destroot -
+        install -
+        archive -
+        activate -
+        dmg -
+        mdmg -
+        pkg -
+        mpkg -
+        rpm -
+        dpkg -
+        srpm -
+        portpkg { return 1 }
+        default { return 0 }
+    }
+}
+
 # Determine dependency types required for target
 proc macports::_deptypes_for_target {target} {
     switch $target {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100614/b1088b4f/attachment.html>


More information about the macports-changes mailing list