[81289] branches/gsoc11-rev-upgrade/base/src/macports1.0/macports.tcl
cal at macports.org
cal at macports.org
Thu Jul 28 19:18:25 PDT 2011
Revision: 81289
http://trac.macports.org/changeset/81289
Author: cal at macports.org
Date: 2011-07-28 19:18:25 -0700 (Thu, 28 Jul 2011)
Log Message:
-----------
rev-upgrade: Implement rebuilding as if one had called port -fn upgrade $broken_port_name
Modified Paths:
--------------
branches/gsoc11-rev-upgrade/base/src/macports1.0/macports.tcl
Modified: branches/gsoc11-rev-upgrade/base/src/macports1.0/macports.tcl
===================================================================
--- branches/gsoc11-rev-upgrade/base/src/macports1.0/macports.tcl 2011-07-29 02:15:17 UTC (rev 81288)
+++ branches/gsoc11-rev-upgrade/base/src/macports1.0/macports.tcl 2011-07-29 02:18:25 UTC (rev 81289)
@@ -3751,10 +3751,7 @@
set run_loop 1
array set broken_port_counts {}
while {$run_loop == 1} {
- if {[catch {revupgrade_scanandrebuild broken_port_counts} run_loop] == 1} {
- ui_error "An error occured while scanning for broken ports and/or trying to rebuild them"
- error "An error occured while scanning for broken ports and/or trying to rebuild them"
- }
+ set run_loop [revupgrade_scanandrebuild broken_port_counts]
}
return 0;
}
@@ -3930,6 +3927,48 @@
ui_msg " [$port name] @[$port version] [$port variants][$port negated_variants]"
}
+ # shared depscache for all ports that are going to be rebuilt
+ array set depscache {}
+ set status 0
+ foreach port $topsort_ports {
+ if {![info exists depscache(port:[$port name])]} {
+ array set variations {}
+
+ set strindex 0
+ set variantsstr "[$port variants][$port negated_variants]"
+ while {$strindex != [string length $variantsstr]} {
+ set type [string index $variantsstr $strindex]
+ if {$type != "+" && $type != "-"} {
+ # ignore char not starting a variant definition
+ incr $strindex
+ continue
+ }
+
+ set endpidx [string first "+" $variantsstr $strindex+1]
+ set endmidx [string first "-" $variantsstr $strindex+1]
+ set endidx [expr $endpidx < $endmidx ? $endpidx : $endmidx]
+
+ if {$endidx != -1} {
+ set variantname [string trim [string range $variantsstr $strindex+1 $endidx]]
+ set strindex $endidx
+ } else {
+ # end of string
+ set variantname [string trim [string range $variantsstr $strindex+1 end]]
+ set strindex [string length $variantsstr]
+ }
+
+ set variations($variantname) $type
+ }
+
+ # make macports::upgrade behave like calling port -f -n upgrade [$port name]
+ set status [macports::upgrade [$port name] "port:[$port name]" [array get variations] {ports_upgrade_force yes ports_nodeps yes} depscache]
+ if {$status != 0 && ![macports::ui_isset ports_processall]} {
+ error "Error rebuilding [$port name]"
+ }
+
+ }
+ }
+
return 1;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20110728/a9a023a4/attachment.html>
More information about the macports-changes
mailing list