<pre style='margin:0'>
Joshua Root (jmroot) pushed a commit to branch master
in repository mpbb.
</pre>
<p><a href="https://github.com/macports/mpbb/commit/4462924d822cb61464b6ecb8badcc9949231527b">https://github.com/macports/mpbb/commit/4462924d822cb61464b6ecb8badcc9949231527b</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit 4462924d822cb61464b6ecb8badcc9949231527b
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Sun Dec 4 13:04:10 2016 +1100
<span style='display:block; white-space:pre;color:#404040;'> Don't double-open ports in dependencies.tcl
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Get default variant info from vinfo instead.
</span>---
tools/dependencies.tcl | 40 +++++++++++-----------------------------
1 file changed, 11 insertions(+), 29 deletions(-)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/tools/dependencies.tcl b/tools/dependencies.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 670a9ed..cf36e5d 100755
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/tools/dependencies.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/tools/dependencies.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -95,45 +95,27 @@ proc printdependency {ditem} {
</span>
array set depinfo [mportinfo $ditem]
<span style='display:block; white-space:pre;background:#ffe0e0;'>- # There's a conceptual problem here: We need to calculate the string to
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # pass to port(1) to build this exact port with its variants, but the
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # active_variants array does not contain an entry for explicitly
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # deactivated default_variants.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #
</span> # To calculate the correct string with the explicitly disabled default
<span style='display:block; white-space:pre;background:#ffe0e0;'>- # variants, if any, we need the default variants first. Unfortunately the
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # only way to get the set of default variants is opening the port without
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # any.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # variants, if any, we need the default variants first.
</span> #
# Given the active_variants of the current dependency calculation and the
<span style='display:block; white-space:pre;background:#ffe0e0;'>- # ones from a pristine port without variants, calculate the required
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # string.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # open the port without variants to determine the default variants
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[llength [array get variants]] > 0} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- #try -pass_signal {...}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- try {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set result [mportlookup $depinfo(name)]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- if {[llength $result] < 2} {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- ui_error "No such port: $depinfo(name)"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- exit 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # default variants, calculate the required string.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set default_variants {}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[array size variants] > 0 && [info exists depinfo(vinfo)]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach {vname vattrs} $depinfo(vinfo) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach {key val} $vattrs {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {$key eq "is_default" && $val eq "+"} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lappend default_variants $vname
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ break
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span> }
<span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- # open the port so we can calculate the default variants
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- array set defaultvariant_portinfo [lindex $result 1]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- set defaultvariant_mport [mportopen $defaultvariant_portinfo(porturl) [list subport $depinfo(name)] {}]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- array set defaultvariant_info [mportinfo $defaultvariant_mport]
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- array set default_variants $defaultvariant_info(active_variants)
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- mportclose $defaultvariant_mport
</span> }
<span style='display:block; white-space:pre;background:#ffe0e0;'>- } else {
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- array set default_variants {}
</span> }
set variantstring ""
array set active_variants $depinfo(active_variants)
<span style='display:block; white-space:pre;background:#ffe0e0;'>- set relevant_variants [lsort -unique [concat [array names active_variants] [array names default_variants]]]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set relevant_variants [lsort -unique [concat [array names active_variants] $default_variants]]
</span> foreach variant $relevant_variants {
if {[info exists active_variants($variant)]} {
append variantstring "$active_variants($variant)$variant"
</pre><pre style='margin:0'>
</pre>