Ignore:
Timestamp:
Jul 12, 2004, 10:51:19 PM (15 years ago)
Author:
wbb4
Message:

Bug:
Submitted by:
Reviewed by:
Approved by:
Obtained from:

Check to see if a variant exists for a specific port before trying to use it. This should fix a lot of dependency issues now that variants are tracked in the registry, and should avoid rebuilding ports multiple times with non-existent variants in order to satisfy dependencies.

File:
1 edited

Legend:

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

    r7620 r7714  
    812812proc variant_run {ditem} {
    813813    set name [ditem_key $ditem name]
    814     ui_debug "Executing $name provides [ditem_key $ditem provides]"
     814    ui_debug "Executing variant $name provides [ditem_key $ditem provides]"
    815815   
    816816    # test for conflicting variants
     
    831831
    832832proc eval_variants {variations target} {
    833     global all_variants ports_force
     833    global all_variants ports_force PortInfo
    834834    set dlist $all_variants
    835835    set result 0
    836836    upvar $variations upvariations
    837837    set chosen [choose_variants $dlist upvariations]
    838    
     838        set portname $PortInfo(name)
     839       
     840        ui_debug "Provided variants: $PortInfo(variants)"
     841        ui_debug "Requested variants: [array get upvariations]"
     842        # Check to make sure the requested variations are available with this port,
     843        # if one is not, warn the user and remove the variant from the array.
     844        foreach key [array names upvariations *] {
     845                if {[lsearch $PortInfo(variants) $key] == -1} {
     846                        ui_debug "Requested variant $key is not provided by port $portname."
     847                        array unset upvariations $key
     848                }
     849        }
     850
    839851    # now that we've selected variants, change all provides [a b c] to [a-b-c]
    840852    # this will eliminate ambiguity between item a, b, and a-b while fulfilling requirments.
     
    845857    set newlist [list]
    846858    foreach variant $chosen {
    847         set newlist [dlist_append_dependents $dlist $variant $newlist]
     859                set newlist [dlist_append_dependents $dlist $variant $newlist]
    848860    }
    849861   
    850862    set dlist [dlist_eval $newlist "" variant_run]
    851863    if {[llength $dlist] > 0} {
    852         return 1
     864                return 1
    853865    }
    854866   
     
    865877       
    866878        if {[check_statefile_variants upvariations $state_fd]} {
    867             ui_error "Requested variants do not match original selection.\nPlease perform 'port clean' or specify the force option."
     879            ui_error "Requested variants do not match original selection.\nPlease perform 'port clean $portname' or specify the force option."
    868880            set result 1
    869881        } else {
Note: See TracChangeset for help on using the changeset viewer.