<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/f68f7adb2100fe357844a013cf56374ff4d28cf1">https://github.com/macports/mpbb/commit/f68f7adb2100fe357844a013cf56374ff4d28cf1</a></p>
<pre style="white-space: pre; background: #F8F8F8"><span style='display:block; white-space:pre;color:#808000;'>commit f68f7adb2100fe357844a013cf56374ff4d28cf1
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Thu Oct 17 23:23:21 2019 +1100

<span style='display:block; white-space:pre;color:#404040;'>    mpbb-list-subports: do arch exclusions in Tcl
</span>---
 mpbb-list-subports           | 16 ----------------
 tools/sort-with-subports.tcl | 19 ++++++++++++++++++-
 2 files changed, 18 insertions(+), 17 deletions(-)

<span style='display:block; white-space:pre;color:#808080;'>diff --git a/mpbb-list-subports b/mpbb-list-subports
</span><span style='display:block; white-space:pre;color:#808080;'>index 30de7e9..b48946f 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/mpbb-list-subports
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/mpbb-list-subports
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -32,13 +32,11 @@ print-subports() {
</span>     local archive_site_private=$2
     local portnames=$3
     local port
<span style='display:block; white-space:pre;background:#ffe0e0;'>-    local portgroup
</span>     local ports
     local exclude
     local exclude_reasons
     local reason
 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-    os_version="$(sw_vers -productVersion | cut -d . -f 1-2)"
</span>     # $option_prefix is set in mpbb
     # shellcheck disable=SC2154
     tclsh=${option_prefix}/bin/port-tclsh
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -74,20 +72,6 @@ print-subports() {
</span>             fi
         fi
 
<span style='display:block; white-space:pre;background:#ffe0e0;'>-        if [[ $exclude -eq 0 && ("${os_version}" = "10.6" || "${os_version}" = "10.5") ]]; then
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-            supported_archs=$("${tclsh}" "${thisdir}/tools/supported-archs.tcl" "${port}")
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-            if [[ -n "${supported_archs}" ]]; then
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                is_64bit_capable="$(sysctl -n hw.cpu64bit_capable)"
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                if [[ "${os_version}" = "10.6" && "${is_64bit_capable}" = "0" && ! ("${supported_archs}" == *"x86_64"* && "${supported_archs}" == *"i386"*) ]]; then
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                    exclude=1
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                    exclude_reasons+=("the ${os_version}_x86_64 builder will build it")
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                elif [[ "${os_version}" = "10.5" && "${supported_archs}" != *"ppc"* && "${supported_archs}" != *"noarch"* ]]; then
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                    exclude=1
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                    exclude_reasons+=("it does not support the ppc arch")
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-                fi
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-            fi
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-        fi
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>-
</span>         if [ $exclude -eq 0 ]; then
             echo "$port"
         else
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/tools/sort-with-subports.tcl b/tools/sort-with-subports.tcl
</span><span style='display:block; white-space:pre;color:#808080;'>index 9e8b77e..30409cc 100755
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/tools/sort-with-subports.tcl
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/tools/sort-with-subports.tcl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -65,6 +65,8 @@ if {[catch {mportinit "" "" ""} result]} {
</span>    error "Failed to initialize ports system: $result"
 }
 
<span style='display:block; white-space:pre;background:#e0ffe0;'>+set is_64bit_capable [sysctl hw.cpu64bit_capable]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> array set portdepinfo {}
 array set canonicalnames {}
 set todo [list]
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -129,7 +131,22 @@ while {$todo ne {}} {
</span>             } elseif {[info exists portinfo(known_fail)] && [string is true -strict $portinfo(known_fail)]} {
                 puts stderr "Excluding $portinfo(name) because it is known to fail"
                 set outputports($p) 0
<span style='display:block; white-space:pre;background:#ffe0e0;'>-            } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            } elseif {$::macports::os_major <= 10} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                if {![catch {mportopen $portinfo(porturl) [list subport $portinfo(name)] ""} result]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    set supported_archs [_mportkey $result supported_archs]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    if {$::macports::os_arch eq "i386" && !${is_64bit_capable} && $supported_archs ne "" && ("x86_64" ni $supported_archs || "i386" ni $supported_archs)} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                        puts stderr "Excluding $portinfo(name) because the ${::macports::macosx_version}_x86_64 builder will build it"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                        set outputports($p) 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    } elseif {$::macports::os_arch eq "powerpc" && $supported_archs ne "" && $supported_archs ne "noarch" && "ppc" ni $supported_archs} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                        puts stderr "Excluding $portinfo(name) because it does not support the ppc arch"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                        set outputports($p) 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    puts stderr "Excluding $portinfo(name) because it failed to open: $result"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                    set outputports($p) 0
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+                }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+            if {$outputports($p) == 1} {
</span>                 set canonicalnames($p) $portinfo(name)
             }
         }
</pre><pre style='margin:0'>

</pre>