<pre style='margin:0'>
Clemens Lang (neverpanic) pushed a commit to branch variant-support
in repository mpbb.

</pre>
<p><a href="https://github.com/macports/mpbb/commit/c6bf5ba29dfc650683eb8fb17bc5239ac9b66feb">https://github.com/macports/mpbb/commit/c6bf5ba29dfc650683eb8fb17bc5239ac9b66feb</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit c6bf5ba29dfc650683eb8fb17bc5239ac9b66feb
</span>Author: Clemens Lang <cal@macports.org>
AuthorDate: Sun Mar 11 16:37:12 2018 +0100

<span style='display:block; white-space:pre;color:#404040;'>    Support specifying variants in mpbb install-port
</span><span style='display:block; white-space:pre;color:#404040;'>    
</span><span style='display:block; white-space:pre;color:#404040;'>    See: https://trac.macports.org/ticket/52742
</span>---
 mpbb-install-port | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

<span style='display:block; white-space:pre;color:#808080;'>diff --git a/mpbb-install-port b/mpbb-install-port
</span><span style='display:block; white-space:pre;color:#808080;'>index 8fc0b72..0c25c28 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/mpbb-install-port
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/mpbb-install-port
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -9,7 +9,7 @@ install-port-usage() {
</span>     # "prog" is defined in mpbb-help.
     # shellcheck disable=SC2154
     cat <<EOF
<span style='display:block; white-space:pre;background:#ffe0e0;'>-usage: $prog [<global opts>] install-port <port>
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+usage: $prog [<global opts>] install-port <port>[@(+|-)variant [...]]
</span> 
 Build and install the given port.
 
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -18,11 +18,12 @@ EOF
</span> }
 
 install-port() {
<span style='display:block; white-space:pre;background:#ffe0e0;'>-    local port=${1-}
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-    if [[ -z $port ]]; then
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    if [[ -z $1 ]]; then
</span>         err "Must specify a port"
         return 1
     fi
<span style='display:block; white-space:pre;background:#e0ffe0;'>+    local port=${1%%@*}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    local portvariants=${1:${#port}+1}
</span>     # $option_log_dir is set in mpbb
     # shellcheck disable=SC2154
     local log_port_contents="${option_log_dir}/port-contents.txt"
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -37,7 +38,7 @@ install-port() {
</span> 
     # $option_prefix and $thisdir are set in mpbb
     # shellcheck disable=SC2154
<span style='display:block; white-space:pre;background:#ffe0e0;'>-    if [[ -f $("${option_prefix}/bin/port-tclsh" "${thisdir}/tools/archive-path.tcl" "$@") ]]; then
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    if [[ -f $("${option_prefix}/bin/port-tclsh" "${thisdir}/tools/archive-path.tcl" "$port" "$portvariants") ]]; then
</span>         echo "$* already installed, nothing to do"
         # log: summary for the portwatcher
         echo "Building '$port' ... [OK]" >> "$log_subports_progress"
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -50,7 +51,7 @@ install-port() {
</span>     time_start=$(date +%s)
     # $option_prefix is set in mpbb
     # shellcheck disable=SC2154
<span style='display:block; white-space:pre;background:#ffe0e0;'>-    if "${option_prefix}/bin/port" -dkn install "$@"; then
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    if "${option_prefix}/bin/port" -dkn install "$port" $portvariants; then
</span>         # Remove failcache if it exists
         failcache_success "$@"
         if [ $? -ne 0 ]; then
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -86,7 +87,7 @@ install-port() {
</span>     local print_arg_workdir="ERROR"
     local print_arg_destdir="ERROR"
     # First, compute port_workdir_size and port_destdir_size
<span style='display:block; white-space:pre;background:#ffe0e0;'>-    port_workdir=$("${option_prefix}/bin/port" work "$port")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    port_workdir=$("${option_prefix}/bin/port" work "$port" $portvariants)
</span>     if [ -n "$port_workdir" ]; then
         port_workdir_size=$(du -ks "$port_workdir" | sed 's/^ *//' | tr '\t' '\n' | head -n 1)
         if [ $? -eq 0 ] && [ -n "$port_workdir_size" ]; then
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -111,7 +112,7 @@ install-port() {
</span> 
     # log: main.log
     local port_mainlog
<span style='display:block; white-space:pre;background:#ffe0e0;'>-    port_mainlog=$("${option_prefix}/bin/port" logfile "$port")
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+    port_mainlog=$("${option_prefix}/bin/port" logfile "$port" $portvariants)
</span>     if [ $? -eq 0 ] && [ -f "$port_mainlog" ]; then
         cp -f "$port_mainlog" "$log_port_main"
     fi
</pre><pre style='margin:0'>

</pre>