<pre style='margin:0'>
Joshua Root (jmroot) pushed a commit to branch release-2.7
in repository macports-base.

</pre>
<p><a href="https://github.com/macports/macports-base/commit/5aa6455db016e5f3f9a263c92da400e405d48c69">https://github.com/macports/macports-base/commit/5aa6455db016e5f3f9a263c92da400e405d48c69</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/release-2.7 by this push:
<span style='display:block; white-space:pre;color:#404040;'>     new 5aa6455d Set requested_variations directly and early
</span>5aa6455d is described below

<span style='display:block; white-space:pre;color:#808000;'>commit 5aa6455db016e5f3f9a263c92da400e405d48c69
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Wed May 19 11:42:52 2021 +1000

<span style='display:block; white-space:pre;color:#404040;'>    Set requested_variations directly and early
</span><span style='display:block; white-space:pre;color:#404040;'>    
</span><span style='display:block; white-space:pre;color:#404040;'>    Setting it based on variations in eval_variants is too late, as
</span><span style='display:block; white-space:pre;color:#404040;'>    default_variants may already have been applied by then. This should fix
</span><span style='display:block; white-space:pre;color:#404040;'>    some unexpected variant propagation behaviour with the mpkg target.
</span><span style='display:block; white-space:pre;color:#404040;'>    
</span><span style='display:block; white-space:pre;color:#404040;'>    (cherry picked from commit 60e74839e66f9f93e44991eca1dabcc315060356)
</span>---
 src/macports1.0/macports.tcl |  3 ++-
 src/port1.0/portutil.tcl     | 14 +++++++++-----
 2 files changed, 11 insertions(+), 6 deletions(-)

<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/macports1.0/macports.tcl b/src/macports1.0/macports.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 8e04a6ad..e9e0b800 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/macports1.0/macports.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/macports1.0/macports.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -1579,7 +1579,8 @@ proc macports::worker_init {workername portpath porturl portbuildpath options va
</span>     }
 
     foreach {var val} $variations {
<span style='display:block; white-space:pre;background:#ffe0e0;'>-        $workername eval "set variations($var) $val"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        $workername eval [list set variations($var) $val]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        $workername eval [list set requested_variations($var) $val]
</span>     }
 }
 
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/src/port1.0/portutil.tcl b/src/port1.0/portutil.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index f38eab25..877f3f28 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/src/port1.0/portutil.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/src/port1.0/portutil.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -2031,8 +2031,6 @@ proc eval_variants {variations} {
</span>     # Check to make sure the requested variations are available with this
     # port, if one is not, warn the user and remove the variant from the
     # array.
<span style='display:block; white-space:pre;background:#ffe0e0;'>-    # Save the originally requested set in requested_variations.
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-    array set requested_variations [array get upvariations]
</span>     foreach key [array names upvariations *] {
         if {![info exists PortInfo(variants)] ||
             $key ni $PortInfo(variants)} {
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -2086,16 +2084,22 @@ proc eval_variants {variations} {
</span>     set PortInfo(active_variants) $activevariants
     set PortInfo(canonical_active_variants) $portvariants
 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-    # now set the requested variants
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    # Now set the requested variants string, based on the requested_variations
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    # array, but narrowed down to the variants that this port actually has,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    # as per the chosen and negated lists.
</span>     set requested_list [list]
     foreach dvar $chosen {
         set thevar [ditem_key $dvar provides]
<span style='display:block; white-space:pre;background:#ffe0e0;'>-        lappend requested_list $thevar "+"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        if {[info exists requested_variations($thevar)]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            lappend requested_list $thevar "+"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        }
</span>     }
     set negated_list [list]
     foreach dvar $negated {
         set thevar [ditem_key $dvar provides]
<span style='display:block; white-space:pre;background:#ffe0e0;'>-        lappend negated_list $thevar "-"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        if {[info exists requested_variations($thevar)]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            lappend negated_list $thevar "-"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+        }
</span>     }
     set requested_variants [canonicalize_variants $requested_list "+"][canonicalize_variants $negated_list "-"]
 
</pre><pre style='margin:0'>

</pre>