[93130] branches/release_2_1/base

cal at macports.org cal at macports.org
Tue May 15 14:19:41 PDT 2012


Revision: 93130
          https://trac.macports.org/changeset/93130
Author:   cal at macports.org
Date:     2012-05-15 14:19:40 -0700 (Tue, 15 May 2012)
Log Message:
-----------
Cherry-pick r93129 from trunk:
rev-upgrade: Fix broken graph of dependents, fix broken topologic sort

Revision Links:
--------------
    https://trac.macports.org/changeset/93129

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

Property Changed:
----------------
    branches/release_2_1/base/


Property changes on: branches/release_2_1/base
___________________________________________________________________
Modified: svn:mergeinfo
   - /branches/gsoc08-privileges/base:37343-46937
/branches/gsoc09-logging/base:51231-60371
/branches/gsoc11-rev-upgrade/base:78828-88375
/branches/universal-sanity/base:51872-52323
/branches/variant-descs-14482/base:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/trunk/base:91825,91829,91834,92072,92342,92404,92546,92730,92785,92881,92903,93062
/users/perry/base-bugs_and_notes:45682-46060
/users/perry/base-select:44044-44692
   + /branches/gsoc08-privileges/base:37343-46937
/branches/gsoc09-logging/base:51231-60371
/branches/gsoc11-rev-upgrade/base:78828-88375
/branches/universal-sanity/base:51872-52323
/branches/variant-descs-14482/base:34469-34855,34900-37508,37511-37512,41040-41463,42575-42626,42640-42659
/trunk/base:91825,91829,91834,92072,92342,92404,92546,92730,92785,92881,92903,93062,93129
/users/perry/base-bugs_and_notes:45682-46060
/users/perry/base-select:44044-44692

Modified: branches/release_2_1/base/src/macports1.0/macports.tcl
===================================================================
--- branches/release_2_1/base/src/macports1.0/macports.tcl	2012-05-15 21:08:50 UTC (rev 93129)
+++ branches/release_2_1/base/src/macports1.0/macports.tcl	2012-05-15 21:19:40 UTC (rev 93130)
@@ -3681,8 +3681,10 @@
             ui_debug "platform mismatch ... upgrading!"
             set build_override 1
         } elseif {$is_revupgrade_second_run} {
+            ui_debug "rev-upgrade override ... upgrading (from source)!"
             set build_override 1
         } elseif {$is_revupgrade} {
+            ui_debug "rev-upgrade override ... upgrading!"
             # in the first run of rev-upgrade, only activate possibly already existing files and check for missing dependencies
             set will_install yes
         } else {
@@ -4356,6 +4358,7 @@
             # initialize with empty list
             set adjlist($port) {}
             set revadjlist($port) {}
+            ui_debug "Broken: [$port name]"
         }
 
         array set visited {}
@@ -4380,6 +4383,7 @@
                 set len [llength $adjlist($port)]
                 if {$len < $lowest_adj_number} {
                     set lowest_adj_port $port
+                    set lowest_adj_number $len
                 }
                 if {$len == 0} {
                     # this node has no further dependencies
@@ -4394,10 +4398,9 @@
                         set index [lsearch -exact $adjlist($target) $port]
                         set adjlist($target) [lreplace $adjlist($target) $index $index]
                     }
+
+                    break;
                 }
-
-                # start anew
-                break;
             }
 
             # if we arrive here and lowest_adj_number is larger than 0, then we
@@ -4511,18 +4514,16 @@
     upvar $revadjlistname revadjlist
     upvar $visitedname visited
 
+    set visited($port) true
+
     ui_debug "Processing port [$port name] @[$port epoch]:[$port version]_[$port revision] [$port variants] [$port negated_variants]"
     set dependent_ports [$port dependents]
     foreach dep $dependent_ports {
-        if {[info exists visited($dep)]} {
-            continue
-        }
-        set visited($dep) true
         set is_broken_port false
 
         if {[info exists adjlist($dep)]} {
-            #ui_debug "Dependency [$dep name] is broken, adding edge from [[lindex $stack 0] name] to [$dep name]"
-            #ui_debug "Making [$dep name] new head of stack"
+            ui_debug "Dependent [$dep name] is broken, adding edge from [$dep name] to [[lindex $stack 0] name]"
+            ui_debug "Making [$dep name] new head of stack"
             # $dep is one of the broken ports
             # add an edge to the last broken port in the DFS
             lappend revadjlist([lindex $stack 0]) $dep
@@ -4532,9 +4533,11 @@
             
             set is_broken_port true
         }
-        revupgrade_buildgraph $dep stack adjlist revadjlist visited
+        if {![info exists visited($dep)]} {
+            revupgrade_buildgraph $dep stack adjlist revadjlist visited
+        }
         if {$is_broken_port} {
-            #ui_debug "Removing [$dep name] from stack"
+            ui_debug "Removing [$dep name] from stack"
             # remove $dep from the stack
             set stack [lrange $stack 1 end]
         }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120515/ebe4d8d5/attachment.html>


More information about the macports-changes mailing list