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

raimue at macports.org raimue at macports.org
Sat Jul 18 06:00:18 PDT 2009


Revision: 54002
          http://trac.macports.org/changeset/54002
Author:   raimue at macports.org
Date:     2009-07-18 06:00:16 -0700 (Sat, 18 Jul 2009)
Log Message:
-----------
port1.0/portutil.tcl:
Fix a bug in check_statefile_variants, which did not work correctly if the old
set of variants has been empty.

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-07-18 12:22:39 UTC (rev 54001)
+++ trunk/base/src/port1.0/portutil.tcl	2009-07-18 13:00:16 UTC (rev 54002)
@@ -1635,6 +1635,8 @@
 proc check_statefile_variants {variations fd} {
     upvar $variations upvariations
 
+    array set oldvariations {}
+
     seek $fd 0
     while {[gets $fd line] >= 0} {
         if {[regexp "variant: (.*)" $line match name]} {
@@ -1643,15 +1645,13 @@
     }
 
     set mismatch 0
-    if {[array size oldvariations] > 0} {
-        if {[array size oldvariations] != [array size upvariations]} {
-            set mismatch 1
-        } else {
-            foreach key [array names upvariations *] {
-                if {![info exists oldvariations($key)] || $upvariations($key) != $oldvariations($key)} {
+    if {[array size oldvariations] != [array size upvariations]} {
+        set mismatch 1
+    } else {
+        foreach key [array names upvariations *] {
+            if {![info exists oldvariations($key)] || $upvariations($key) != $oldvariations($key)} {
                 set mismatch 1
                 break
-                }
             }
         }
     }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090718/85361910/attachment.html>


More information about the macports-changes mailing list