[48483] trunk/base/src/port1.0/portutil.tcl

raimue at macports.org raimue at macports.org
Mon Mar 23 02:49:32 PDT 2009


Revision: 48483
          http://trac.macports.org/changeset/48483
Author:   raimue at macports.org
Date:     2009-03-23 02:49:31 -0700 (Mon, 23 Mar 2009)
Log Message:
-----------
port1.0/portutil.tcl:
Use target_state to determine if the statefile is required, closes #18270

Modified Paths:
--------------
    trunk/base/src/port1.0/portutil.tcl

Modified: trunk/base/src/port1.0/portutil.tcl
===================================================================
--- trunk/base/src/port1.0/portutil.tcl	2009-03-23 07:52:45 UTC (rev 48482)
+++ trunk/base/src/port1.0/portutil.tcl	2009-03-23 09:49:31 UTC (rev 48483)
@@ -1855,21 +1855,29 @@
 }
 
 proc check_variants {variations target} {
-    global ports_force ports_dryrun PortInfo
+    global targets ports_force ports_dryrun PortInfo
     upvar $variations upvariations
     set result 0
     set portname $PortInfo(name)
     
     # Make sure the variations match those stored in the statefile.
-    # If they don't match, print an error indicating a 'port clean' 
-    # should be performed.  
+    # If they don't match, print an error indicating a 'port clean'
+    # should be performed.
+    # - Skip this test if the target indicated target_state no
     # - Skip this test if the statefile is empty.
-    # - Skip this test if performing a clean or submit.
     # - Skip this test if ports_force was specified.
-   
-    # TODO: Don't hardcode this list of targets here,
-    #       check for [ditem_key $mport state] == "no" somewhere else instead
-    if { [lsearch "clean submit lint livecheck" $target] < 0 &&
+
+    # Assume we do not need the statefile
+    set statereq 0
+    set ditems [dlist_search $targets provides $target]
+    foreach d $ditems {
+        if {[ditem_key $d state] != "no"} {
+            # At least one matching target requires the state file
+            set statereq 1
+            break
+        }
+    }
+    if { $statereq &&
         !([info exists ports_force] && $ports_force == "yes")} {
         
         set state_fd [open_statefile]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090323/ee39e578/attachment.html>


More information about the macports-changes mailing list