[54018] trunk/base/src/port1.0/portutil.tcl
raimue at macports.org
raimue at macports.org
Sat Jul 18 19:01:34 PDT 2009
Revision: 54018
http://trac.macports.org/changeset/54018
Author: raimue at macports.org
Date: 2009-07-18 19:01:33 -0700 (Sat, 18 Jul 2009)
Log Message:
-----------
port1.0/portutil.tcl:
check_statefile_variants fills list of old variants, will be used in the error
message in order to let the user understand what is going on.
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-19 01:10:36 UTC (rev 54017)
+++ trunk/base/src/port1.0/portutil.tcl 2009-07-19 02:01:33 UTC (rev 54018)
@@ -1630,12 +1630,18 @@
flush $fd
}
-# check_statefile_variants
+##
# Check that recorded selection of variants match the current selection
-proc check_statefile_variants {variations fd} {
+#
+# @param variations input array name of new variants
+# @param oldvariations output array name of old variants
+# @param fd file descriptor of the state file
+# @return 0 if variants match, 1 otherwise
+proc check_statefile_variants {variations oldvariations fd} {
upvar $variations upvariations
+ upvar $oldvariations upoldvariations
- array set oldvariations {}
+ array set upoldvariations {}
seek $fd 0 end
if {[tell $fd] == 0} {
@@ -1646,16 +1652,16 @@
seek $fd 0
while {[gets $fd line] >= 0} {
if {[regexp "variant: (.*)" $line match name]} {
- set oldvariations([string range $name 1 end]) [string range $name 0 0]
+ set upoldvariations([string range $name 1 end]) [string range $name 0 0]
}
}
set mismatch 0
- if {[array size oldvariations] != [array size upvariations]} {
+ if {[array size upoldvariations] != [array size upvariations]} {
set mismatch 1
} else {
foreach key [array names upvariations *] {
- if {![info exists oldvariations($key)] || $upvariations($key) != $oldvariations($key)} {
+ if {![info exists upoldvariations($key)] || $upvariations($key) != $upoldvariations($key)} {
set mismatch 1
break
}
@@ -1844,8 +1850,9 @@
set state_fd [open_statefile]
- if {[check_statefile_variants upvariations $state_fd]} {
- ui_error "Requested variants do not match original selection.\nPlease perform 'port clean $portname' or specify the force option."
+ array set oldvariations {}
+ if {[check_statefile_variants upvariations oldvariations $state_fd]} {
+ ui_error "Requested variants \"[canonicalize_variants [array get upvariations]]\" do not match original selection \"[canonicalize_variants [array get oldvariations]]\".\nPlease use the same variants again, perform 'port clean $portname' or specify the force option (-f)."
set result 1
} elseif {!([info exists ports_dryrun] && $ports_dryrun == "yes")} {
# Write variations out to the statefile
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20090718/ada0c597/attachment.html>
More information about the macports-changes
mailing list