[34513] trunk/base/src/port1.0
afb at macports.org
afb at macports.org
Wed Feb 27 02:00:59 PST 2008
Revision: 34513
http://trac.macosforge.org/projects/macports/changeset/34513
Author: afb at macports.org
Date: 2008-02-27 02:00:57 -0800 (Wed, 27 Feb 2008)
Log Message:
-----------
add target_state variable patch from raimue, for targets that don't need state (#13458)
Modified Paths:
--------------
trunk/base/src/port1.0/portlint.tcl
trunk/base/src/port1.0/portmain.tcl
trunk/base/src/port1.0/portutil.tcl
Modified: trunk/base/src/port1.0/portlint.tcl
===================================================================
--- trunk/base/src/port1.0/portlint.tcl 2008-02-27 09:36:56 UTC (rev 34512)
+++ trunk/base/src/port1.0/portlint.tcl 2008-02-27 10:00:57 UTC (rev 34513)
@@ -7,6 +7,7 @@
set org.macports.lint [target_new org.macports.lint lint_main]
target_runtype ${org.macports.lint} always
+target_state ${org.macports.lint} no
target_provides ${org.macports.lint} lint
target_requires ${org.macports.lint} main
target_prerun ${org.macports.lint} lint_start
Modified: trunk/base/src/port1.0/portmain.tcl
===================================================================
--- trunk/base/src/port1.0/portmain.tcl 2008-02-27 09:36:56 UTC (rev 34512)
+++ trunk/base/src/port1.0/portmain.tcl 2008-02-27 10:00:57 UTC (rev 34513)
@@ -38,6 +38,7 @@
set org.macports.main [target_new org.macports.main main]
target_provides ${org.macports.main} main
+target_state ${org.macports.main} no
# define options
options prefix name version revision epoch categories maintainers
Modified: trunk/base/src/port1.0/portutil.tcl
===================================================================
--- trunk/base/src/port1.0/portutil.tcl 2008-02-27 09:36:56 UTC (rev 34512)
+++ trunk/base/src/port1.0/portutil.tcl 2008-02-27 10:00:57 UTC (rev 34513)
@@ -1038,6 +1038,11 @@
set result 0
set skipped 0
set procedure [ditem_key $ditem procedure]
+
+ if {[ditem_key $ditem state] != "no"} {
+ set target_state_fd [open_statefile]
+ }
+
if {$procedure != ""} {
set name [ditem_key $ditem name]
@@ -1048,7 +1053,8 @@
if {$result == 0} {
# Skip the step if required and explain why through ui_debug.
# 1st case: the step was already done (as mentioned in the state file)
- if {[check_statefile target $name $target_state_fd]} {
+ if {[ditem_key $ditem state] != "no"
+ && [check_statefile target $name $target_state_fd]} {
ui_debug "Skipping completed $name ($portname)"
set skipped 1
# 2nd case: the step is not to always be performed
@@ -1233,6 +1239,10 @@
set result 1
}
+ if {[ditem_key $ditem state] != "no"} {
+ close $target_state_fd
+ }
+
return $result
}
@@ -1285,9 +1295,6 @@
}
}
- # Restore the state from a previous run.
- set target_state_fd [open_statefile]
-
set dlist [dlist_eval $dlist "" target_run]
if {[llength $dlist] > 0} {
@@ -1302,7 +1309,6 @@
set result 0
}
- close $target_state_fd
return $result
}
@@ -1564,8 +1570,10 @@
# - 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.
-
- if { [lsearch "clean submit" $target] < 0 &&
+
+ # 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 &&
!([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/20080227/abecc824/attachment.html
More information about the macports-changes
mailing list