Changeset 54018


Ignore:
Timestamp:
Jul 19, 2009, 2:01:33 AM (10 years ago)
Author:
raimue@…
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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/port1.0/portutil.tcl

    r54017 r54018  
    16311631}
    16321632
    1633 # check_statefile_variants
     1633##
    16341634# Check that recorded selection of variants match the current selection
    1635 proc check_statefile_variants {variations fd} {
     1635#
     1636# @param variations input array name of new variants
     1637# @param oldvariations output array name of old variants
     1638# @param fd file descriptor of the state file
     1639# @return 0 if variants match, 1 otherwise
     1640proc check_statefile_variants {variations oldvariations fd} {
    16361641    upvar $variations upvariations
    1637 
    1638     array set oldvariations {}
     1642    upvar $oldvariations upoldvariations
     1643
     1644    array set upoldvariations {}
    16391645
    16401646    seek $fd 0 end
     
    16471653    while {[gets $fd line] >= 0} {
    16481654        if {[regexp "variant: (.*)" $line match name]} {
    1649             set oldvariations([string range $name 1 end]) [string range $name 0 0]
     1655            set upoldvariations([string range $name 1 end]) [string range $name 0 0]
    16501656        }
    16511657    }
    16521658
    16531659    set mismatch 0
    1654     if {[array size oldvariations] != [array size upvariations]} {
     1660    if {[array size upoldvariations] != [array size upvariations]} {
    16551661        set mismatch 1
    16561662    } else {
    16571663        foreach key [array names upvariations *] {
    1658             if {![info exists oldvariations($key)] || $upvariations($key) != $oldvariations($key)} {
     1664            if {![info exists upoldvariations($key)] || $upvariations($key) != $upoldvariations($key)} {
    16591665                set mismatch 1
    16601666                break
     
    18451851        set state_fd [open_statefile]
    18461852
    1847         if {[check_statefile_variants upvariations $state_fd]} {
    1848             ui_error "Requested variants do not match original selection.\nPlease perform 'port clean $portname' or specify the force option."
     1853        array set oldvariations {}
     1854        if {[check_statefile_variants upvariations oldvariations $state_fd]} {
     1855            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)."
    18491856            set result 1
    18501857        } elseif {!([info exists ports_dryrun] && $ports_dryrun == "yes")} {
Note: See TracChangeset for help on using the changeset viewer.