Skip to content

Commit

Permalink
Apply global_variations when opening port in action_variants
Browse files Browse the repository at this point in the history
Leaving these out could cause incorrect default variants to be
displayed for ports that change them based on which variants are
actually requested.

(cherry picked from commit 9e63a61)
  • Loading branch information
jmroot committed Feb 2, 2017
1 parent ddc8032 commit aced306
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/port/port.tcl
Expand Up @@ -3563,14 +3563,23 @@ proc action_variants { action portlist opts } {
}

if {!([info exists options(ports_variants_index)] && $options(ports_variants_index) eq "yes")} {
# Add any global_variations to the variations specified for
# the port (default variants may change based on this)
array unset merged_variations
array set merged_variations [array get variations]
foreach {variation value} [array get global_variations] {
if {![info exists merged_variations($variation)]} {
set merged_variations($variation) $value
}
}
if {![info exists options(subport)]} {
if {[info exists portinfo(name)]} {
set options(subport) $portinfo(name)
} else {
set options(subport) $portname
}
}
if {[catch {set mport [mportopen $porturl [array get options] [array get variations]]} result]} {
if {[catch {set mport [mportopen $porturl [array get options] [array get merged_variations]]} result]} {
ui_debug "$::errorInfo"
break_softcontinue "Unable to open port: $result" 1 status
}
Expand Down

0 comments on commit aced306

Please sign in to comment.