[69026] trunk/base/src

jmr at macports.org jmr at macports.org
Sun Jun 20 17:53:46 PDT 2010


Revision: 69026
          http://trac.macports.org/changeset/69026
Author:   jmr at macports.org
Date:     2010-06-20 17:53:45 -0700 (Sun, 20 Jun 2010)
Log Message:
-----------
skip build deps and build-time checks when running targets on ports that are installed or have an archive available

Modified Paths:
--------------
    trunk/base/src/macports1.0/macports.tcl
    trunk/base/src/package1.0/portunarchive.tcl
    trunk/base/src/port1.0/portutil.tcl

Modified: trunk/base/src/macports1.0/macports.tcl
===================================================================
--- trunk/base/src/macports1.0/macports.tcl	2010-06-21 00:45:23 UTC (rev 69025)
+++ trunk/base/src/macports1.0/macports.tcl	2010-06-21 00:53:45 UTC (rev 69026)
@@ -1582,20 +1582,23 @@
     set dlist {}
     if {[macports::_target_needs_deps $target]} {
 
-        # possibly warn or error out depending on how old xcode is
-        if {[$workername eval _check_xcode_version] != 0} {
-            return 1
+        # see if we actually need to build this port
+        if {![$workername eval registry_exists \$name \$version \$revision \$portvariants]} {
+            # possibly warn or error out depending on how old xcode is
+            if {[$workername eval _check_xcode_version] != 0} {
+                return 1
+            }
+            # error out if selected arch(s) not supported by this port
+            if {[$workername eval check_supported_archs] != 0} {
+                return 1
+            }
+    
+            # upgrade dependencies that are already installed
+            if {![macports::global_option_isset ports_nodeps]} {
+                macports::_upgrade_mport_deps $mport $target
+            }
         }
-        # error out if selected arch(s) not supported by this port
-        if {[$workername eval check_supported_archs] != 0} {
-            return 1
-        }
 
-        # upgrade dependencies that are already installed
-        if {![macports::global_option_isset ports_nodeps]} {
-            macports::_upgrade_mport_deps $mport $target
-        }
-
         ui_msg -nonewline "--->  Computing dependencies for [_mportkey $mport name]"
         if {[macports::ui_isset ports_debug]} {
             # play nice with debug messages
@@ -1682,7 +1685,7 @@
 proc macports::_upgrade_mport_deps {mport target} {
     set options [ditem_key $mport options]
     set workername [ditem_key $mport workername]
-    set deptypes [macports::_deptypes_for_target $target]
+    set deptypes [macports::_deptypes_for_target $target $workername]
     array set portinfo [mportinfo $mport]
     array set depscache {}
 
@@ -2431,7 +2434,8 @@
         }
     }
 
-    set deptypes [macports::_deptypes_for_target $target]
+    set workername [ditem_key $mport workername]
+    set deptypes [macports::_deptypes_for_target $target $workername]
 
     set subPorts {}
     if {[llength $deptypes] > 0} {
@@ -2440,7 +2444,6 @@
         set optionsarray(ports_requested) 0
         set options [array get optionsarray]
         set variations [ditem_key $mport variations]
-        set workername [ditem_key $mport workername]
         set required_archs [$workername eval get_canonical_archs]
         set depends_skip_archcheck [_mportkey $mport depends_skip_archcheck]
     }
@@ -2645,38 +2648,48 @@
         mpkg -
         rpm -
         dpkg -
-        srpm -
-        portpkg { return 1 }
+        srpm { return 1 }
         default { return 0 }
     }
 }
 
 # Determine dependency types required for target
-proc macports::_deptypes_for_target {target} {
+proc macports::_deptypes_for_target {target workername} {
     switch $target {
         fetch       -
-        checksum    { set deptypes "depends_fetch" }
+        checksum    { return "depends_fetch" }
         extract     -
-        patch       { set deptypes "depends_fetch depends_extract" }
+        patch       { return "depends_fetch depends_extract" }
         configure   -
-        build       { set deptypes "depends_fetch depends_extract depends_build depends_lib" }
-
+        build       { return "depends_fetch depends_extract depends_build depends_lib" }
         test        -
-        destroot    -
-        install     -
-        activate    -
+        srpm        -
+        destroot    { return "depends_fetch depends_extract depends_build depends_lib depends_run" }
         archive     -
         dmg         -
         pkg         -
-        portpkg     -
         mdmg        -
         mpkg        -
         rpm         -
-        srpm        -
-        dpkg        -
-        ""          { set deptypes "depends_fetch depends_extract depends_build depends_lib depends_run" }
+        dpkg        {
+            if {[$workername eval _archive_available]} {
+                return "depends_lib depends_run"
+            } else {
+                return "depends_fetch depends_extract depends_build depends_lib depends_run"
+            }
+        }
+        install     -
+        activate    -
+        ""          {
+            if {[$workername eval registry_exists \$name \$version \$revision \$portvariants]
+                || [$workername eval _archive_available]} {
+                return "depends_lib depends_run"
+            } else {
+                return "depends_fetch depends_extract depends_build depends_lib depends_run"
+            }
+        }
     }
-    return $deptypes
+    return ""
 }
 
 # selfupdate procedure

Modified: trunk/base/src/package1.0/portunarchive.tcl
===================================================================
--- trunk/base/src/package1.0/portunarchive.tcl	2010-06-21 00:45:23 UTC (rev 69025)
+++ trunk/base/src/package1.0/portunarchive.tcl	2010-06-21 00:53:45 UTC (rev 69026)
@@ -103,7 +103,7 @@
                 set archstring [join [get_canonical_archs] -]
                 set unarchive.file "${name}-${version}_${revision}${portvariants}.${archstring}.${unarchive.type}"
                 set unarchive.path "[file join ${unarchive.fullsrcpath} ${unarchive.file}]"
-                if {[file exist ${unarchive.path}]} {
+                if {[file isfile ${unarchive.path}]} {
                     set found 1
                     break
                 } else {

Modified: trunk/base/src/port1.0/portutil.tcl
===================================================================
--- trunk/base/src/port1.0/portutil.tcl	2010-06-21 00:45:23 UTC (rev 69025)
+++ trunk/base/src/port1.0/portutil.tcl	2010-06-21 00:53:45 UTC (rev 69026)
@@ -2611,3 +2611,37 @@
     }
     return 0
 }
+
+# check if we can unarchive this port
+proc _archive_available {} {
+    global name version revision portvariants ports_source_only
+    global unarchive.srcpath workpath
+
+    if {[option portarchivemode] != "yes" || [tbool ports_source_only]} {
+        return 0
+    }
+
+    # Define archive directory, file, and path
+    if {![string equal ${unarchive.srcpath} ${workpath}] && ![string equal ${unarchive.srcpath} ""]} {
+        if {[llength [get_canonical_archs]] > 1} {
+            set unarchive.fullsrcpath [file join ${unarchive.srcpath} [option os.platform] "universal"]
+        } else {
+            set unarchive.fullsrcpath [file join ${unarchive.srcpath} [option os.platform] [get_canonical_archs]]
+        }
+    } else {
+        set unarchive.fullsrcpath ${unarchive.srcpath}
+    }
+
+    set found 0
+    foreach unarchive.type [option portarchivetype] {
+        if {[catch {archiveTypeIsSupported ${unarchive.type}} errmsg] == 0} {
+            set archstring [join [get_canonical_archs] -]
+            set unarchive.file "${name}-${version}_${revision}${portvariants}.${archstring}.${unarchive.type}"
+            if {[file isfile [file join ${unarchive.fullsrcpath} ${unarchive.file}]]} {
+                set found 1
+                break
+            }
+        }
+    }
+    return $found
+}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100620/5307b6a4/attachment-0001.html>


More information about the macports-changes mailing list