<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/97f4db4f3eabaabcf005b0758a3b32d36525c395">https://github.com/macports/mpbb/commit/97f4db4f3eabaabcf005b0758a3b32d36525c395</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new 97f4db4 List subports in dependency order
</span>97f4db4 is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 97f4db4f3eabaabcf005b0758a3b32d36525c395
</span>Author: Joshua Root <jmr@macports.org>
AuthorDate: Tue Mar 13 11:43:43 2018 +1100
<span style='display:block; white-space:pre;color:#404040;'> List subports in dependency order
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Closes: https://trac.macports.org/ticket/52766
</span>---
mpbb-list-subports | 8 +--
tools/sort-with-subports.tcl | 131 +++++++++++++++++++++++++++++++++++++++++++
2 files changed, 134 insertions(+), 5 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 724d6aa..cb9cc91 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;'>@@ -25,7 +25,7 @@ EOF
</span>
print-subports() {
local archive_site=$1
<span style='display:block; white-space:pre;background:#ffe0e0;'>- local portname=$2
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ local portnames=$2
</span> local port
local portgroup
local ports
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -39,7 +39,7 @@ print-subports() {
</span> tclsh=${option_prefix}/bin/port-tclsh
# $option_prefix is set in mpbb
# shellcheck disable=SC2154
<span style='display:block; white-space:pre;background:#ffe0e0;'>- ports=$("${option_prefix}/bin/port" -q info --index --line --name "${portname}" "subportof:${portname}" 2>/dev/null) || return
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ports=$("${tclsh}" "${thisdir}/tools/sort-with-subports.tcl" ${portnames} 2>/dev/null) || return
</span> for port in $ports; do
exclude=0
exclude_reasons=()
<span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -125,9 +125,7 @@ list-subports() {
</span> mkdir -p "$option_log_dir"
> "$log_subports_progress"
<span style='display:block; white-space:pre;background:#ffe0e0;'>- for p in "$@"; do
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- print-subports "$option_archive_site" "$p" && success=1
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>- done
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ print-subports "$option_archive_site" "$*" && success=1
</span>
if [ $success -eq 0 ]; then
err "None of the specified ports were found in the port index."
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/tools/sort-with-subports.tcl b/tools/sort-with-subports.tcl
</span>new file mode 100755
<span style='display:block; white-space:pre;color:#808080;'>index 0000000..1d3ba80
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</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;'>@@ -0,0 +1,131 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#!/usr/bin/env port-tclsh
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Generates a list of ports where a port is only listed after all of its
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# dependencies (sans variants) have already been listed. Includes all
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# sub-ports of the specified ports.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Copyright (c) 2006,2008 Bryan L Blackburn. All rights reserved.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Copyright (c) 2018 The MacPorts Project
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Redistribution and use in source and binary forms, with or without
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# modification, are permitted provided that the following conditions
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# are met:
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# 1. Redistributions of source code must retain the above copyright
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# notice, this list of conditions and the following disclaimer.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# 2. Redistributions in binary form must reproduce the above copyright
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# notice, this list of conditions and the following disclaimer in
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# the documentation and/or other materials provided with the
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# distribution.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# 3. Neither the name Bryan L Blackburn, nor the names of any contributors
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# may be used to endorse or promote products derived from this software
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# without specific prior written permission.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</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;'>+package require macports
</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;'>+proc ui_prefix {priority} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return "OUT: "
</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;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+proc ui_channels {priority} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ return {}
</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;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+proc process_port_deps {portname portdeps_in portlist_in} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ upvar $portdeps_in portdeps
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ upvar $portlist_in portlist
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[lsearch -exact $portlist $portname] == -1} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[info exists portdeps($portname)]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach portdep $portdeps($portname) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[lsearch -exact $portlist $portdep] == -1} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ process_port_deps $portdep portdeps portlist
</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;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lappend portlist $portname
</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;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+if {[catch {mportinit "" "" ""} result]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts stderr "$errorInfo"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ error "Failed to initialize ports system: $result"
</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;'>+array set portdepinfo {}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+set todo [list]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+if {[lindex $argv 0] eq "-"} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ while {[gets stdin line] >= 0} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lappend todo [string trim $line]
</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;'>+ set todo $argv
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# save the ones that the user actually wants to know about
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+foreach p $todo {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set inputports($p) 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set outputports($p) 1
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# process all recursive deps
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+set depstypes {depends_fetch depends_extract depends_build depends_lib depends_run}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+while {$todo ne {}} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set p [lindex $todo 0]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set todo [lrange $todo 1 end]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[catch {mportlookup $p} result]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts stderr "$errorInfo"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ error "Failed to find port '$p': $result"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[llength $result] < 2} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts stderr "port $p not found in the index"
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ continue
</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;'>+ array set portinfo [lindex $result 1]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set portname $portinfo(name)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[info exists inputports($portname)] && [info exists portinfo(subports)]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach subport $portinfo(subports) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lappend todo $subport
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set outputports($subport) 1
</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 {![info exists portdepinfo($portname)]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set deplist [list]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach depstype $depstypes {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[info exists portinfo($depstype)] && $portinfo($depstype) != ""} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ foreach onedep $portinfo($depstype) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set depname [lindex [split [lindex $onedep 0] :] end]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lappend deplist $depname
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ lappend todo $depname
</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;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ set portdepinfo($portname) $deplist
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ array unset portinfo
</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;'>+set portlist [list]
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+foreach portname [lsort -dictionary [array names portdepinfo]] {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ process_port_deps $portname portdepinfo portlist
</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;'>+foreach portname $portlist {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if {[info exists outputports($portname)]} {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ puts $portname
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span></pre><pre style='margin:0'>
</pre>