<!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>[152528] 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/152528">152528</a></dd>
<dt>Author</dt> <dd>larryv@macports.org</dd>
<dt>Date</dt> <dd>2016-09-11 18:59:04 -0700 (Sun, 11 Sep 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>mpbb: Implement new help system
The `--help` option has been replaced by a new `help` subcommand.
Invoking `mpbb help` displays global usage and available subcommands,
while `mpbb help <subcommand>` displays subcommand-specific usage.
Each subcommand script `mpbb-FOO` must now define a function `FOO-usage`
that prints its specific help to standard out.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#contribmpbuildbotmpbb">contrib/mp-buildbot/mpbb</a></li>
<li><a href="#contribmpbuildbotmpbbcheckout">contrib/mp-buildbot/mpbb-checkout</a></li>
<li><a href="#contribmpbuildbotmpbbcleanup">contrib/mp-buildbot/mpbb-cleanup</a></li>
<li><a href="#contribmpbuildbotmpbbgatherarchives">contrib/mp-buildbot/mpbb-gather-archives</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>
<li><a href="#contribmpbuildbotmpbblistsubports">contrib/mp-buildbot/mpbb-list-subports</a></li>
<li><a href="#contribmpbuildbotmpbbselfupdate">contrib/mp-buildbot/mpbb-selfupdate</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#contribmpbuildbotmpbbhelp">contrib/mp-buildbot/mpbb-help</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="contribmpbuildbotmpbb"></a>
<div class="modfile"><h4>Modified: contrib/mp-buildbot/mpbb (152527 => 152528)</h4>
<pre class="diff"><span>
<span class="info">--- contrib/mp-buildbot/mpbb        2016-09-12 01:59:00 UTC (rev 152527)
+++ contrib/mp-buildbot/mpbb        2016-09-12 01:59:04 UTC (rev 152528)
</span><span class="lines">@@ -14,60 +14,32 @@
</span><span class="cx"> err() { msg error: "$@"; }
</span><span class="cx"> warn() { msg warning: "$@"; }
</span><span class="cx">
</span><del>-usage() {
- cols=$(tput cols) || cols=80
</del><ins>+mpbb-usage() {
+ # "prog" is defined in mpbb-help.
+ # shellcheck disable=SC2154
+ cat <<EOF
+usage: $prog [<global options>] <command> [<args>]
</ins><span class="cx">
</span><del>- fmt -w $(( cols - 8 )) >&2 <<-EOF
-Usage: $0 COMMAND [OPTION...]
</del><ins>+Build MacPorts ports in a continuous integration environment.
</ins><span class="cx">
</span><del>-mpbb, a script to help build MacPorts ports in a continous integration
-environment.
</del><ins>+Global options:
</ins><span class="cx">
</span><del>-OPTIONS
</del><ins>+ --prefix=<path>
+ The prefix of the MacPorts installation that will be used for
+ building ports. Defaults to \`/opt/local'.
</ins><span class="cx">
</span><del>- --archive-site=URL
- Base URL of the packages archive to check whether an archive was not
- published yet. Default is "https://packages.macports.org".
</del><ins>+ --work-dir=<path>
+ A working directory to be used for storing temporary files,
+ accessible by the MacPorts installation specified with \`--prefix'.
+ The directory should persist between runs of \`mpbb'. Defaults to
+ the value of \$PWD or \`/tmp/mp-buildbot'.
</ins><span class="cx">
</span><del>- --help
- Print this usage message.
</del><ins>+Available commands:
</ins><span class="cx">
</span><del>- --prefix=PREFIX
- The prefix of the MacPorts installation that will build the ports. Defaults
- to "/opt/local".
</del><ins>+ ${cmds[0]}$(printf ', %s' "${cmds[@]:1}")
</ins><span class="cx">
</span><del>- --svn=BINARY
- Absolute path to the svn binary that you want to use for SVN operations. The
- default is to find svn in your path.
-
- --svn-url=SVNURL
- URL to a Subversion repository in a format accepted by Subversion. The
- referenced folder must contain a dports and a base folder. The default is
- "https://svn.macports.org/repository/macports/trunk".
-
- --svn-revision=REVISION
- Revision number in the specified Subversion repository to checkout. Defaults
- to "HEAD".
-
- --staging-dir=DIR
- Directory where new distributable archives should be copied for deployment
- on the archive server. Defaults to the 'archive-staging' subfolder in the
- current directory.
-
- --work-dir=WORKDIR
- A scratch area that mpbb will use to put temporary files, ideally kept
- between builds. Your MacPorts installation in --prefix needs to be able to
- access this location. Defaults to your current directory, or
- /tmp/mp-buildbot if \$PWD isn't set.
</del><ins>+Run \`$prog help <command>' for per-command help.
</ins><span class="cx"> EOF
</span><del>-
- printf >&2 "\nCOMMANDS\n"
- for command in "${commands[@]}"; do
- printf >&2 " %s\n" "$command"
- printf " %s\n\n" "$("${command}-help" | tr '\n' ' ')" | fmt -w $(( cols - 8 )) >&2
- done
-
- exit 2
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> # TODO Documentation, obviously :)
</span><span class="lines">@@ -86,7 +58,7 @@
</span><span class="cx"> ;;
</span><span class="cx"> 1)
</span><span class="cx"> # getopt(1) will print the bad argument to standard error.
</span><del>- echo >&2 "Try \`$0 --help' for more information."
</del><ins>+ echo >&2 "Try \`$0 help' for more information."
</ins><span class="cx"> return 2
</span><span class="cx"> ;;
</span><span class="cx"> *)
</span><span class="lines">@@ -138,13 +110,12 @@
</span><span class="cx"> fi
</span><span class="cx">
</span><span class="cx"> # Process options.
</span><del>-parseopt help,prefix:,work-dir: "$@" || exit
</del><ins>+parseopt prefix:,work-dir: "$@" || exit
</ins><span class="cx">
</span><span class="cx"> # Use sensible defaults for options that weren't set on the command line.
</span><span class="cx"> : "${option_port=}"
</span><span class="cx"> : "${option_prefix=/opt/local}"
</span><span class="cx"> : "${option_work_dir=${PWD:-/tmp/mp-buildbot}}"
</span><del>-: "${option_help=0}"
</del><span class="cx">
</span><span class="cx"> # shellcheck disable=SC2034 disable=SC2154
</span><span class="cx"> # Not really options, but pretend they are because they're global.
</span><span class="lines">@@ -156,15 +127,18 @@
</span><span class="cx"> set -- ${args+"${args[@]}"}
</span><span class="cx">
</span><span class="cx"> # Load the subcommand implementations. Each sourced script "mpbb-FOO"
</span><del>-# must define functions "FOO" and "FOO-help".
</del><ins>+# must define functions "FOO" and "FOO-usage".
</ins><span class="cx"> cmds=()
</span><ins>+usages=(mpbb-usage)
</ins><span class="cx"> thisdir=$(cd "$(dirname "$0")" && pwd)
</span><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 class="cx"> # shellcheck disable=SC1090
</span><span class="cx"> if . "$cmdfile"; then
</span><del>- cmds+=("${cmdfile##*/mpbb-}")
</del><ins>+ cmd=${cmdfile##*/mpbb-}
+ cmds+=("$cmd")
+ usages+=("${cmd}-usage")
</ins><span class="cx"> else
</span><span class="cx"> err "failed to load subcommand script \`$cmdfile'"
</span><span class="cx"> exit 3
</span><span class="lines">@@ -173,7 +147,8 @@
</span><span class="cx">
</span><span class="cx"> if (( $# < 1 )); then
</span><span class="cx"> err "No command specified"
</span><del>- usage
</del><ins>+ echo >&2 "Try \`$0 help' for more information."
+ exit 2
</ins><span class="cx"> fi
</span><span class="cx">
</span><span class="cx"> subcmd=$1
</span><span class="lines">@@ -185,14 +160,10 @@
</span><span class="cx"> done
</span><span class="cx"> if (( $? != 0 || ${#cmds[@]} == 0 )); then
</span><span class="cx"> err "Unknown command \`$command'"
</span><del>- usage
</del><ins>+ echo >&2 "Try \`$0 help' for more information."
+ exit 2
</ins><span class="cx"> fi
</span><span class="cx">
</span><del>-## If subcommand help is requested, print that
-if [[ $option_help -eq 1 ]]; then
- usage
-fi
-
</del><span class="cx"> ## Otherwise, run the command and deal with errors
</span><span class="cx"> PORTSRC=${option_work_dir}/macports.conf "$subcmd" "$@"
</span><span class="cx"> readonly rc=$?
</span></span></pre></div>
<a id="contribmpbuildbotmpbbcheckout"></a>
<div class="modfile"><h4>Modified: contrib/mp-buildbot/mpbb-checkout (152527 => 152528)</h4>
<pre class="diff"><span>
<span class="info">--- contrib/mp-buildbot/mpbb-checkout        2016-09-12 01:59:00 UTC (rev 152527)
+++ contrib/mp-buildbot/mpbb-checkout        2016-09-12 01:59:04 UTC (rev 152528)
</span><span class="lines">@@ -5,12 +5,32 @@
</span><span class="cx"> # This script is sourced by the mpbb wrapper script.
</span><span class="cx"> # Do not execute this directly!
</span><span class="cx">
</span><ins>+checkout-usage() {
+ # "prog" is defined in mpbb-help.
+ # shellcheck disable=SC2154
+ cat <<EOF
+usage: $prog [<global opts>] checkout [<opts>]
</ins><span class="cx">
</span><del>-checkout-help() {
- cat <<EOF
-Update or checkout a working copy of the ports tree from --svn-url to specific
-SVN revision (--svn-revision), update or create the PortIndex and configure
-the MacPorts installation to use this ports tree.
</del><ins>+Obtain a working copy of the jobs tools and ports tree and configure
+MacPorts to use the latter as a port source.
+
+Options:
+
+ --svn=<path>
+ A command-line Subversion client. Defaults to the first \`svn'
+ executable found in \$PATH.
+
+ --svn-url=<URL>
+ URL to a Subversion repository that contains \`dports' and
+ \`base/portmgr/jobs' subdirectories. Only used when checking out
+ a new working copy. Defaults to
+ \`https://svn.macports.org/repository/macports/trunk'.
+
+ --svn-revision=<rev>
+ Revision number at which the ports tree will be checked out.
+ Defaults to \`HEAD'.
+
+Run \`$prog help' for global options and a list of other subcommands.
</ins><span class="cx"> EOF
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="contribmpbuildbotmpbbcleanup"></a>
<div class="modfile"><h4>Modified: contrib/mp-buildbot/mpbb-cleanup (152527 => 152528)</h4>
<pre class="diff"><span>
<span class="info">--- contrib/mp-buildbot/mpbb-cleanup        2016-09-12 01:59:00 UTC (rev 152527)
+++ contrib/mp-buildbot/mpbb-cleanup        2016-09-12 01:59:04 UTC (rev 152528)
</span><span class="lines">@@ -5,8 +5,16 @@
</span><span class="cx"> # This script is sourced by the mpbb wrapper script.
</span><span class="cx"> # Do not execute this directly!
</span><span class="cx">
</span><del>-cleanup-help() {
- echo "Clean up remnants from previous builds."
</del><ins>+cleanup-usage() {
+ # "prog" is defined in mpbb-help.
+ # shellcheck disable=SC2154
+ cat <<EOF
+usage: $prog [<global opts>] cleanup
+
+Clean up after a build.
+
+Run \`$prog help' for global options and a list of other subcommands.
+EOF
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> cleanup() {
</span></span></pre></div>
<a id="contribmpbuildbotmpbbgatherarchives"></a>
<div class="modfile"><h4>Modified: contrib/mp-buildbot/mpbb-gather-archives (152527 => 152528)</h4>
<pre class="diff"><span>
<span class="info">--- contrib/mp-buildbot/mpbb-gather-archives        2016-09-12 01:59:00 UTC (rev 152527)
+++ contrib/mp-buildbot/mpbb-gather-archives        2016-09-12 01:59:04 UTC (rev 152528)
</span><span class="lines">@@ -5,9 +5,28 @@
</span><span class="cx"> # This script is sourced by the mpbb wrapper script.
</span><span class="cx"> # Do not execute this directly!
</span><span class="cx">
</span><ins>+gather-archives-usage() {
+ # "prog" is defined in mpbb-help.
+ # shellcheck disable=SC2154
+ cat <<EOF
+usage: $prog [<global opts>] gather-archives [<opts>]
</ins><span class="cx">
</span><del>-gather-archives-help() {
- echo "Gather unpublished distributable archives of the built port and its dependencies."
</del><ins>+Copy unpublished, distributable archives of active ports into a staging
+directory for uploading.
+
+Options:
+
+ --archive-site=<URL>
+ URL of a mirror to check for preexisting archives. Defaults to
+ \`https://packages.macports.org'.
+
+ --staging-dir=<path>
+ A directory for storing distributable archives before deployment.
+ Defaults to the \`archive-staging' subdirectory of the \`--work-dir'
+ working directory.
+
+Run \`$prog help' for global options and a list of other subcommands.
+EOF
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> gather-archives() {
</span></span></pre></div>
<a id="contribmpbuildbotmpbbhelp"></a>
<div class="addfile"><h4>Added: contrib/mp-buildbot/mpbb-help (0 => 152528)</h4>
<pre class="diff"><span>
<span class="info">--- contrib/mp-buildbot/mpbb-help         (rev 0)
+++ contrib/mp-buildbot/mpbb-help        2016-09-12 01:59:04 UTC (rev 152528)
</span><span class="lines">@@ -0,0 +1,37 @@
</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
+
+# Note:
+# This script is sourced by the mpbb wrapper script.
+# Do not execute this directly!
+
+help-usage() {
+ cat <<EOF
+usage: $prog help [<command>]
+
+Show usage information for \`$prog' or a specific \`$prog' subcommand.
+
+Run \`$prog help' for global options and a list of other subcommands.
+EOF
+}
+
+help() {
+ local cols helpfunc prog
+ cols=$(tput cols) || cols=80
+ # The main program should define "mpbb-usage", which is called if
+ # "mpbb help" is invoked without any arguments.
+ helpfunc=${1-mpbb}-usage
+ prog=$(basename "$0")
+ readonly cols helpfunc prog
+
+ # This loop exits with 0 if usages contains helpfunc or is empty.
+ for usage in "${usages[@]}"; do
+ [[ $usage == "$helpfunc" ]] && break
+ done
+ if (( $? != 0 || ${#usages[@]} == 0 )); then
+ err "No help available for subcommand \`${helpfunc%-usage}'"
+ return 2
+ fi
+
+ "$helpfunc" | fmt -w $((cols - 8)) >&2
+}
</ins></span></pre></div>
<a id="contribmpbuildbotmpbbinstalldependencies"></a>
<div class="modfile"><h4>Modified: contrib/mp-buildbot/mpbb-install-dependencies (152527 => 152528)</h4>
<pre class="diff"><span>
<span class="info">--- contrib/mp-buildbot/mpbb-install-dependencies        2016-09-12 01:59:00 UTC (rev 152527)
+++ contrib/mp-buildbot/mpbb-install-dependencies        2016-09-12 01:59:04 UTC (rev 152528)
</span><span class="lines">@@ -5,9 +5,16 @@
</span><span class="cx"> # This script is sourced by the mpbb wrapper script.
</span><span class="cx"> # Do not execute this directly!
</span><span class="cx">
</span><ins>+install-dependencies-usage() {
+ # "prog" is defined in mpbb-help.
+ # shellcheck disable=SC2154
+ cat <<EOF
+usage: $prog [<global opts>] install-dependencies <port>
</ins><span class="cx">
</span><del>-install-dependencies-help() {
- echo "Build and install all dependencies of port --port."
</del><ins>+Build and install the dependencies of the given port.
+
+Run \`$prog help' for global options and a list of other subcommands.
+EOF
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> get-maintainers() {
</span></span></pre></div>
<a id="contribmpbuildbotmpbbinstallport"></a>
<div class="modfile"><h4>Modified: contrib/mp-buildbot/mpbb-install-port (152527 => 152528)</h4>
<pre class="diff"><span>
<span class="info">--- contrib/mp-buildbot/mpbb-install-port        2016-09-12 01:59:00 UTC (rev 152527)
+++ contrib/mp-buildbot/mpbb-install-port        2016-09-12 01:59:04 UTC (rev 152528)
</span><span class="lines">@@ -5,9 +5,16 @@
</span><span class="cx"> # This script is sourced by the mpbb wrapper script.
</span><span class="cx"> # Do not execute this directly!
</span><span class="cx">
</span><ins>+install-port-usage() {
+ # "prog" is defined in mpbb-help.
+ # shellcheck disable=SC2154
+ cat <<EOF
+usage: $prog [<global opts>] install-port [<opts>] <port>
</ins><span class="cx">
</span><del>-install-port-help() {
- echo "Build and install the port --port itself."
</del><ins>+Build and install the given port.
+
+Run \`$prog help' for global options and a list of other subcommands.
+EOF
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> get-maintainers() {
</span></span></pre></div>
<a id="contribmpbuildbotmpbblistsubports"></a>
<div class="modfile"><h4>Modified: contrib/mp-buildbot/mpbb-list-subports (152527 => 152528)</h4>
<pre class="diff"><span>
<span class="info">--- contrib/mp-buildbot/mpbb-list-subports        2016-09-12 01:59:00 UTC (rev 152527)
+++ contrib/mp-buildbot/mpbb-list-subports        2016-09-12 01:59:04 UTC (rev 152528)
</span><span class="lines">@@ -5,10 +5,16 @@
</span><span class="cx"> # This script is sourced by the mpbb wrapper script.
</span><span class="cx"> # Do not execute this directly!
</span><span class="cx">
</span><ins>+list-subports-usage() {
+ # "prog" is defined in mpbb-help.
+ # shellcheck disable=SC2154
+ cat <<EOF
+usage: $prog [<global opts>] list-subports <port> [<port2> [...]]
</ins><span class="cx">
</span><del>-list-subports-help() {
- echo "Print the name of port --port and its subports."
- echo "Alternatively, print the name and subports of multiple ports given as positional arguments."
</del><ins>+Print the name and subports of each given port to standard output.
+
+Run \`$prog help' for global options and a list of other subcommands.
+EOF
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> print-subports() {
</span></span></pre></div>
<a id="contribmpbuildbotmpbbselfupdate"></a>
<div class="modfile"><h4>Modified: contrib/mp-buildbot/mpbb-selfupdate (152527 => 152528)</h4>
<pre class="diff"><span>
<span class="info">--- contrib/mp-buildbot/mpbb-selfupdate        2016-09-12 01:59:00 UTC (rev 152527)
+++ contrib/mp-buildbot/mpbb-selfupdate        2016-09-12 01:59:04 UTC (rev 152528)
</span><span class="lines">@@ -5,8 +5,17 @@
</span><span class="cx"> # This script is sourced by the mpbb wrapper script.
</span><span class="cx"> # Do not execute this directly!
</span><span class="cx">
</span><del>-selfupdate-help() {
- echo "Run selfupdate --nosync in the MacPorts installation specified by the --prefix flag"
</del><ins>+selfupdate-usage() {
+ # "prog" is defined in mpbb-help.
+ # shellcheck disable=SC2154
+ cat <<EOF
+usage: $prog [<global options>] selfupdate
+
+Install or update the auxiliary MacPorts base installation. (To reindex
+port sources, use \`$prog checkout'.)
+
+Run \`$prog help' for global options and a list of other subcommands.
+EOF
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> selfupdate() {
</span></span></pre>
</div>
</div>
</body>
</html>