<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[152581] contrib/mp-buildbot</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="https://trac.macports.org/changeset/152581">152581</a></dd>
<dt>Author</dt> <dd>cal@macports.org</dd>
<dt>Date</dt> <dd>2016-09-12 12:14:24 -0700 (Mon, 12 Sep 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>mp-buildbot: Don't re-run previously failed builds
If a port's build has previously failed, we do not want to waste cycles
to re-attempt it (e.g. as dependencies of other ports), unless the
failed port's definition has changed.
To achieve that, create a file with a reference to the last failed build
for every failing port, and fail builds that depend on failed ports
early.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#contribmpbuildbotREADMEmd">contrib/mp-buildbot/README.md</a></li>
<li><a href="#contribmpbuildbotmpbb">contrib/mp-buildbot/mpbb</a></li>
<li><a href="#contribmpbuildbotmpbbinstalldependencies">contrib/mp-buildbot/mpbb-install-dependencies</a></li>
<li><a href="#contribmpbuildbotmpbbinstallport">contrib/mp-buildbot/mpbb-install-port</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#contribmpbuildbotfunctions">contrib/mp-buildbot/functions</a></li>
<li><a href="#contribmpbuildbottoolscanonical_variantstcl">contrib/mp-buildbot/tools/canonical_variants.tcl</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="contribmpbuildbotREADMEmd"></a>
<div class="modfile"><h4>Modified: contrib/mp-buildbot/README.md (152580 => 152581)</h4>
<pre class="diff"><span>
<span class="info">--- contrib/mp-buildbot/README.md        2016-09-12 19:13:35 UTC (rev 152580)
+++ contrib/mp-buildbot/README.md        2016-09-12 19:14:24 UTC (rev 152581)
</span><span class="lines">@@ -91,3 +91,6 @@
</span><span class="cx"> persist for the duration of an `mpbb` run, so it may be used to
</span><span class="cx"> share ancillary files (e.g., a Subversion checkout of the ports
</span><span class="cx"> tree) between builds of different ports.
</span><ins>+- `$option_failcache_dir`:
+ A directory for storing information about previously failed builds which
+ saves time because builds that are known to fail will not be attempted.
</ins></span></pre></div>
<a id="contribmpbuildbotfunctions"></a>
<div class="addfile"><h4>Added: contrib/mp-buildbot/functions (0 => 152581)</h4>
<pre class="diff"><span>
<span class="info">--- contrib/mp-buildbot/functions         (rev 0)
+++ contrib/mp-buildbot/functions        2016-09-12 19:14:24 UTC (rev 152581)
</span><span class="lines">@@ -0,0 +1,134 @@
</span><ins>+#!/bin/bash
+# -*- coding: utf-8; mode: sh; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=sh:et:sw=4:ts=4:sts=4
+
+# Helper functions for mp-buildbot
+
+# Print $0 and arguments to standard error.
+# Unset IFS to ensure "$*" uses spaces as separators.
+msg() (unset IFS; printf >&2 '%s: %s\n' "$0" "$*")
+err() { msg error: "$@"; }
+warn() { msg warning: "$@"; }
+
+## Compute a failcache hash for the given port
+#
+# Computes and prints a hash uniquely identifying a specific state of a port's
+# definition files, including the Portfile's hash as well as the port's
+# patchfiles. To build the hash, this function executes the following
+# algorithm:
+# - For the Portfile, and each file in files/ (if any), calculate a SHA256
+# hash
+# - Sort the hash values alphabetically
+# - Hash the result using SHA256
+# This means a failcache entry will not match if a patchfile changes. A common
+# case where this is the desired behavior is a port committed without
+# a required patchfile.
+#
+# Valid arguments are all arguments accepted by "port dir".
+compute_failcache_hash() {
+ local portdir
+ local -a filelist
+
+ portdir=$("${option_prefix}/bin/port" dir "$@")
+ if [ $? -ne 0 ] || [ -z "$portdir" ]; then
+ err "Could not compute failcache hash: port dir" "$@" "failed"
+ return 1
+ fi
+
+ if [ ! -d "$portdir" ]; then
+ err "Port directory $portdir does not exist"
+ return 2
+ fi
+
+ filelist=("$portdir/Portfile")
+ if [ -d "$portdir/files" ]; then
+ filelist+=("$portdir/files")
+ fi
+
+ find "${filelist[@]}" -type f -exec openssl dgst -sha256 {} \; |\
+ cut -d' ' -f2 |\
+ sort |\
+ openssl dgst -sha256 |\
+ cut -d' ' -f2
+}
+
+## Compute a key that uniquely identifies a (port, variants, portfile-hash) tuple
+#
+# Valid arguments are a port name, optionally followed by a variant
+# specification. Invokes "port dir" to find the Portfile and patchfiles and
+# computes a checksum of these files that will become part of the hash.
+failcache_key() {
+ local port=$1
+ if [ -z "$port" ]; then
+ err "failcache_key expects a port argument, but none was given."
+ return 1
+ fi
+
+ local checksum
+ checksum=$(compute_failcache_hash "$port")
+ if [ $? -ne 0 ]; then
+ err "compute_failcache_hash $port failed"
+ return 2
+ fi
+
+ local canonical_variants
+ canonical_variants=$("${option_prefix}/bin/port-tclsh" "${thisdir}/tools/canonical_variants.tcl" "$@")
+ if [ $? -ne 0 ]; then
+ err "tools/canonical_variants.tcl" "$@" "failed"
+ return 4
+ fi
+
+ echo "$port $canonical_variants $checksum"
+}
+
+## Test whether a given port with variants has previously failed.
+#
+# Valid arguments are a port name, optionally followed by a variant
+# specification. Succeeds if the port did not previsouly fail to build,
+# fails if the port is known to fail.
+failcache_test() {
+ local key
+ key=$(failcache_key "$@")
+ if [ $? -ne 0 ]; then
+ err "Could not determine failcache key for" "$@"
+ return 1
+ fi
+
+ if [ -f "${option_failcache_dir}/${key}" ]; then
+ printf "port %s previously failed in build %s\n" "${key}" "$(<"${option_failcache_dir}/${key}")"
+ return 1
+ else
+ return 0
+ fi
+}
+
+## Mark a build of a given port with variants as successful.
+#
+# Valid arguments are a port name, optionally followed by a variant
+# specification. Removes any database entries that marked a port as failed.
+failcache_success() {
+ local key
+ key=$(failcache_key "$@")
+ if [ $? -ne 0 ]; then
+ err "Could not determine failcache key for" "$@"
+ return 1
+ fi
+
+ rm -f "${option_failcache_dir}/${key}"
+}
+
+## Mark a build of a given port with variants as failed.
+#
+# Valid arguments are a port name, optionally followed by a variant
+# specification. Creates or updates the timestamp of a database entry that
+# marks a port as failed.
+failcache_failure() {
+ local key
+ key=$(failcache_key "$@")
+ if [ $? -ne 0 ]; then
+ err "Could not determine failcache key for" "$@"
+ return 1
+ fi
+
+ mkdir -p "${option_failcache_dir}"
+ echo "${BUILDBOT_BUILDURL:-unknown}" > "${option_failcache_dir}/${key}"
+}
</ins></span></pre></div>
<a id="contribmpbuildbotmpbb"></a>
<div class="modfile"><h4>Modified: contrib/mp-buildbot/mpbb (152580 => 152581)</h4>
<pre class="diff"><span>
<span class="info">--- contrib/mp-buildbot/mpbb        2016-09-12 19:13:35 UTC (rev 152580)
+++ contrib/mp-buildbot/mpbb        2016-09-12 19:14:24 UTC (rev 152581)
</span><span class="lines">@@ -8,11 +8,10 @@
</span><span class="cx"> # Don't inherit any option variables from the calling environment.
</span><span class="cx"> unset "${!option_@}"
</span><span class="cx">
</span><del>-# Print $0 and arguments to standard error.
-# Unset IFS to ensure "$*" uses spaces as separators.
-msg() (unset IFS; printf >&2 '%s: %s\n' "$0" "$*")
-err() { msg error: "$@"; }
-warn() { msg warning: "$@"; }
</del><ins>+# Load function library
+thisdir=$(cd "$(dirname "$0")" && pwd)
+# shellcheck source=functions
+. "$thisdir/functions"
</ins><span class="cx">
</span><span class="cx"> mpbb-usage() {
</span><span class="cx"> # "prog" is defined in mpbb-help.
</span><span class="lines">@@ -126,6 +125,7 @@
</span><span class="cx"> option_jobs_dir=${option_work_dir}/infrastructure/jobs
</span><span class="cx"> option_log_dir=${option_work_dir}/logs
</span><span class="cx"> }
</span><ins>+option_failcache_dir=${option_work_dir}/failcache
</ins><span class="cx">
</span><span class="cx"> # Inform the user if old repositories are still present.
</span><span class="cx"> if [[ -d ${option_work_dir}/tools/.svn ]]; then
</span><span class="lines">@@ -146,7 +146,6 @@
</span><span class="cx"> # must define functions "FOO" and "FOO-usage".
</span><span class="cx"> cmds=()
</span><span class="cx"> usages=(mpbb-usage)
</span><del>-thisdir=$(cd "$(dirname "$0")" && pwd)
</del><span class="cx"> for cmdfile in "$thisdir/mpbb-"*; do
</span><span class="cx"> # Unfortunately ShellCheck does not currently support following multiple
</span><span class="cx"> # files, so we'll just disable the warning.
</span></span></pre></div>
<a id="contribmpbuildbotmpbbinstalldependencies"></a>
<div class="modfile"><h4>Modified: contrib/mp-buildbot/mpbb-install-dependencies (152580 => 152581)</h4>
<pre class="diff"><span>
<span class="info">--- contrib/mp-buildbot/mpbb-install-dependencies        2016-09-12 19:13:35 UTC (rev 152580)
+++ contrib/mp-buildbot/mpbb-install-dependencies        2016-09-12 19:14:24 UTC (rev 152581)
</span><span class="lines">@@ -41,6 +41,9 @@
</span><span class="cx"> local dependencies
</span><span class="cx"> local dependencies_count
</span><span class="cx"> local dependencies_counter
</span><ins>+ local depname
+ local depvariants
+ local failcachecounter
</ins><span class="cx"> # $option_log_dir is set in mpbb
</span><span class="cx"> # shellcheck disable=SC2154
</span><span class="cx"> local log_status_dependencies="${option_log_dir}/dependencies-progress.txt"
</span><span class="lines">@@ -53,7 +56,7 @@
</span><span class="cx"> # calculate list of dependencies in-order
</span><span class="cx"> # $option_prefix and $thisdir are set in mpbb
</span><span class="cx"> # shellcheck disable=SC2154
</span><del>- dependencies=$("${option_prefix}/bin/port-tclsh" "${thisdir}/tools/dependencies.tcl" "$port")
</del><ins>+ dependencies=$("${option_prefix}/bin/port-tclsh" "${thisdir}/tools/dependencies.tcl" "$@")
</ins><span class="cx"> if [ $? -ne 0 ]; then
</span><span class="cx"> echo "Calculating dependencies for '$port' failed, aborting." >&2
</span><span class="cx"> echo "Building '$port' ... [ERROR] (failed to calculate dependencies) maintainers: $(get-maintainers "$port")." >> "$log_subports_progress"
</span><span class="lines">@@ -72,26 +75,67 @@
</span><span class="cx"> echo "$dependencies" | sed -E 's/^/ - /' | tee -a "$log_status_dependencies"
</span><span class="cx"> echo >> "$log_status_dependencies"
</span><span class="cx">
</span><del>- echo "$dependencies" | while read -r dependency; do
</del><ins>+ # Check whether any of the dependencies have previously failed
+ failcachecounter=0
+ while read -r dependency; do
</ins><span class="cx"> # Split portname +variant1+variant2 into portname and variants, where
</span><span class="cx"> # the variants are optional.
</span><span class="cx"> depname=${dependency%% *}
</span><span class="cx"> depvariants=${dependency:${#depname}+1}
</span><span class="cx">
</span><ins>+ # $depvariants isn't quoted on purpose
+ # shellcheck disable=SC2086
+ if ! failcache_test "$depname" $depvariants; then
+ text="Dependency '${depname}' with variants '${depvariants}' has previously failed and is required."
+ echo "$text" >&2
+ echo "$text" >> "$log_status_dependencies"
+ echo "Building '$port' ... [ERROR] (failed to install dependency '${depname}') maintainers: $(get-maintainers "$port" "${depname}")." >> "$log_subports_progress"
+ failcachecounter=$((failcachecounter + 1))
+ fi
+ done <<<"$dependencies"
+
+ if [ $failcachecounter -gt 0 ]; then
+ echo "Aborting build because $failcachecounter dependencies are known to fail." >&2
+ return 1
+ fi
+
+ while read -r dependency; do
+ # Split portname +variant1+variant2 into portname and variants, where
+ # the variants are optional.
+ depname=${dependency%% *}
+ depvariants=${dependency:${#depname}+1}
+
</ins><span class="cx"> text="Installing dependency ($dependencies_counter of $dependencies_count) '${depname}' with variants '${depvariants}'"
</span><span class="cx"> echo "----> ${text}"
</span><span class="cx"> echo -n "${text} ... " >> "$log_status_dependencies"
</span><span class="cx"> # $depvariants isn't quoted on purpose
</span><span class="cx"> # shellcheck disable=SC2086
</span><span class="cx"> if ! "${option_prefix}/bin/port" -d install --unrequested "$depname" $depvariants; then
</span><del>- echo "Build of dependency '${depname}' failed, aborting." >&2
</del><ins>+ echo "Build of dependency '${depname}' with variants '${depvariants}' failed, aborting." >&2
</ins><span class="cx"> echo "[FAIL]" >> "$log_status_dependencies"
</span><span class="cx"> echo "Building '$port' ... [ERROR] (failed to install dependency '${depname}') maintainers: $(get-maintainers "$port" "${depname}")." >> "$log_subports_progress"
</span><ins>+
+ # Update failcache
+ # $depvariants isn't quoted on purpose
+ # shellcheck disable=SC2086
+ failcache_failure "$depname" $depvariants
+ if [ $? -ne 0 ]; then
+ err "failcache_failure $depname $depvariants failed."
+ return 1
+ fi
</ins><span class="cx"> return 1
</span><span class="cx"> else
</span><span class="cx"> echo "[OK]" >> "$log_status_dependencies"
</span><ins>+ # Remove failcache if it exists
+ # $depvariants isn't quoted on purpose
+ # shellcheck disable=SC2086
+ failcache_success "$depname" $depvariants
+ if [ $? -ne 0 ]; then
+ err "failcache_success $depname $depvariants failed."
+ return 1
+ fi
</ins><span class="cx"> dependencies_counter=$((dependencies_counter + 1))
</span><span class="cx"> fi
</span><del>- done
</del><ins>+ done <<<"$dependencies"
</ins><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="contribmpbuildbotmpbbinstallport"></a>
<div class="modfile"><h4>Modified: contrib/mp-buildbot/mpbb-install-port (152580 => 152581)</h4>
<pre class="diff"><span>
<span class="info">--- contrib/mp-buildbot/mpbb-install-port        2016-09-12 19:13:35 UTC (rev 152580)
+++ contrib/mp-buildbot/mpbb-install-port        2016-09-12 19:14:24 UTC (rev 152581)
</span><span class="lines">@@ -55,10 +55,23 @@
</span><span class="cx"> time_start=$(date +%s)
</span><span class="cx"> # $option_prefix is set in mpbb
</span><span class="cx"> # shellcheck disable=SC2154
</span><del>- if ! "${option_prefix}/bin/port" -dk install "$port"; then
</del><ins>+ if "${option_prefix}/bin/port" -dk install "$@"; then
+ # Remove failcache if it exists
+ failcache_success "$@"
+ if [ $? -ne 0 ]; then
+ err "failcache_success" "$@" "failed."
+ return 1
+ fi
+ else
</ins><span class="cx"> echo "Build of '$port' failed."
</span><span class="cx"> # log: summary for the portwatcher
</span><span class="cx"> echo "Building '$port' ... [ERROR] maintainers: $(get-maintainers "$port")." >> "$log_subports_progress"
</span><ins>+ # update failcache
+ failcache_failure "$@"
+ if [ $? -ne 0 ]; then
+ err "failcache_failure" "$@" "failed."
+ return 1
+ fi
</ins><span class="cx"> return 1
</span><span class="cx"> fi
</span><span class="cx"> time_stop=$(date +%s)
</span></span></pre></div>
<a id="contribmpbuildbottoolscanonical_variantstcl"></a>
<div class="addfile"><h4>Added: contrib/mp-buildbot/tools/canonical_variants.tcl (0 => 152581)</h4>
<pre class="diff"><span>
<span class="info">--- contrib/mp-buildbot/tools/canonical_variants.tcl         (rev 0)
+++ contrib/mp-buildbot/tools/canonical_variants.tcl        2016-09-12 19:14:24 UTC (rev 152581)
</span><span class="lines">@@ -0,0 +1,97 @@
</span><ins>+#!/usr/bin/env port-tclsh
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+# Writes the canonical list of variants as it appears in binary archive names
+# to stdout.
+#
+# Copyright (c) 2016 The MacPorts Project.
+# Copyright (c) 2016 Clemens Lang <cal@macports.org>
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1. Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# 2. Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# 3. Neither the name of the MacPorts project, nor the names of any contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
+# AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS
+# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
+# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+package require macports
+
+if {[llength $::argv] == 0} {
+ puts stderr "Usage: $argv0 <portname> \[(+|-)variant...\]"
+ exit 1
+}
+
+# initialize macports
+if {[catch {mportinit "" "" ""} result]} {
+ ui_error "$errorInfo"
+ ui_error "Failed to initialize ports sytem: $result"
+ exit 1
+}
+
+# look up the path of the Portfile for the given port
+set portname [lindex $::argv 0]
+#try -pass_signal {...}
+try {
+ set result [mportlookup $portname]
+ if {[llength $result] < 2} {
+ ui_error "No such port: $portname"
+ exit 1
+ }
+} catch {{*} eCode eMessage} {
+ ui_error "mportlookup $portname failed: $eMessage"
+ exit 1
+}
+
+# parse the given variants from the command line
+array set variants {}
+foreach item [lrange $::argv 1 end] {
+ foreach {_ sign variant} [regexp -all -inline -- {([-+])([[:alpha:]_]+[\w\.]*)} $item] {
+ set variants($variant) $sign
+ }
+}
+
+# open the port to get its active variants
+array set portinfo [lindex $result 1]
+#try -pass_signal {...}
+try {
+ set mport [mportopen $portinfo(porturl) [list subport $portname] [array get variants]]
+} catch {{*} eCode eMessage} {
+ ui_error "mportopen ${portinfo(porturl)} failed: $eMessage"
+ exit 1
+}
+
+array set info [mportinfo $mport]
+puts $info(canonical_active_variants)
+
+#try -pass_signal {...}
+try {
+ mportclose $mport
+} catch {{*} eCode eMessage} {
+ ui_warn "mportclose $portname failed: $eMessage"
+}
+
+# shut down MacPorts
+#try -pass_signal {...}
+try {
+ mportshutdown
+} catch {{*} eCode eMessage} {
+ ui_error "mportshutdown failed: $eMessage"
+ exit 1
+}
</ins><span class="cx">Property changes on: contrib/mp-buildbot/tools/canonical_variants.tcl
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnexecutable"></a>
<div class="addfile"><h4>Added: svn:executable</h4></div>
<a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
</div>
</body>
</html>