[152162] contrib
larryv at macports.org
larryv at macports.org
Tue Aug 30 13:50:45 PDT 2016
Revision: 152162
https://trac.macports.org/changeset/152162
Author: larryv at macports.org
Date: 2016-08-30 13:50:45 -0700 (Tue, 30 Aug 2016)
Log Message:
-----------
mpbb: Deprecate "--port" option
Relevant subcommands now accept port names in the positional parameters,
as "list-subports" already did.
Keep the option functional until the updated Buildbot config goes live.
Modified Paths:
--------------
contrib/buildbot-test/master.cfg
contrib/mp-buildbot/README.md
contrib/mp-buildbot/mpbb
contrib/mp-buildbot/mpbb-install-dependencies
contrib/mp-buildbot/mpbb-install-port
contrib/mp-buildbot/mpbb-list-subports
Modified: contrib/buildbot-test/master.cfg
===================================================================
--- contrib/buildbot-test/master.cfg 2016-08-30 19:46:41 UTC (rev 152161)
+++ contrib/buildbot-test/master.cfg 2016-08-30 20:50:45 UTC (rev 152162)
@@ -381,7 +381,7 @@
#portbuilder_factory.addStep(InfoStep(title=WithProperties("Port %(portname)s")))
portbuilder_factory.addStep(Compile(
- command=['./mpbb/mpbb', 'install-dependencies', '--prefix', WithProperties(prefix), '--port', WithProperties('%(portname)s')],
+ command=['./mpbb/mpbb', 'install-dependencies', '--prefix', WithProperties(prefix), WithProperties('%(portname)s')],
name="install-dependencies",
description=["installing", "dependencies"],
descriptionDone=["install", "dependencies"],
@@ -389,7 +389,7 @@
haltOnFailure=True))
portbuilder_factory.addStep(Compile(
- command=['./mpbb/mpbb', 'install-port', '--prefix', WithProperties(prefix), '--port', WithProperties('%(portname)s')],
+ command=['./mpbb/mpbb', 'install-port', '--prefix', WithProperties(prefix), WithProperties('%(portname)s')],
name="install-port",
description=["installing", "port"],
descriptionDone=["install", "port"],
Modified: contrib/mp-buildbot/README.md
===================================================================
--- contrib/mp-buildbot/README.md 2016-08-30 19:46:41 UTC (rev 152161)
+++ contrib/mp-buildbot/README.md 2016-08-30 20:50:45 UTC (rev 152162)
@@ -27,25 +27,19 @@
--svn-url https://svn.macports.org/repository/macports/trunk \
--svn-revision 123456
-3. Print to standard output a list of all subports for one port...
+3. Print one or more ports' subports to standard output.
- mpbb list-subports --prefix /opt/local --port php
+ mpbb list-subports --prefix /opt/local php cmake llvm-3.8 [...]
- ...or for several.
-
- mpbb list-subports --prefix /opt/local cmake llvm-3.8 ...
-
4. For each subport listed in step 3:
a. Install dependencies.
- mpbb install-dependencies \
- --prefix /opt/local \
- --port php71
+ mpbb install-dependencies --prefix /opt/local php71
b. Install the subport itself.
- mpbb install-port --prefix /opt/local --port php71
+ mpbb install-port --prefix /opt/local php71
c. Gather archives.
@@ -87,8 +81,6 @@
The name of the subcommand.
- `$option_archive_site`:
The URL of the mirror to check for preexisting archives.
-- `$option_port`:
- The name of the port to install.
- `$option_prefix`:
The prefix of the MacPorts installation.
- `$option_staging_dir`:
Modified: contrib/mp-buildbot/mpbb
===================================================================
--- contrib/mp-buildbot/mpbb 2016-08-30 19:46:41 UTC (rev 152161)
+++ contrib/mp-buildbot/mpbb 2016-08-30 20:50:45 UTC (rev 152162)
@@ -52,10 +52,6 @@
--help
Print this usage message.
- --port PORT
- Name of the port to build in MacPorts. This is required for the steps that
- build a port.
-
--variants VARIANTS
An optional string with port variants (empty by default; not fully
functional yet).
@@ -144,6 +140,7 @@
option_help=1
;;
--port)
+ # Deprecated and will be removed in the near future.
option_port=$2
shift
;;
Modified: contrib/mp-buildbot/mpbb-install-dependencies
===================================================================
--- contrib/mp-buildbot/mpbb-install-dependencies 2016-08-30 19:46:41 UTC (rev 152161)
+++ contrib/mp-buildbot/mpbb-install-dependencies 2016-08-30 20:50:45 UTC (rev 152162)
@@ -19,6 +19,11 @@
}
install-dependencies() {
+ local port=${1-${option_port-}}
+ if [[ -z $port ]]; then
+ err "Must specify a port"
+ return 1
+ fi
local dependencies
local dependencies_count
local dependencies_counter
@@ -27,11 +32,6 @@
local log_status_dependencies="${option_logdir}/dependencies-progress.txt"
local log_subports_progress="${option_logdir}/ports-progress.txt"
- if [ -z "${option_port:-}" ]; then
- err "--port is required"
- return 1
- fi
-
# prepare the log file and make sure to start with an empty one
mkdir -p "${option_logdir}"
> "$log_status_dependencies"
@@ -39,22 +39,22 @@
# calculate list of dependencies in-order
# $option_prefix and $thisdir are set in mpbb
# shellcheck disable=SC2154
- dependencies=$("${option_prefix}/bin/port-tclsh" "${thisdir}/tools/dependencies.tcl" "${option_port}" "${option_variants}")
+ dependencies=$("${option_prefix}/bin/port-tclsh" "${thisdir}/tools/dependencies.tcl" "$port" "${option_variants}")
if [ $? -ne 0 ]; then
- echo "Calculating dependencies for '${option_port}' failed, aborting." >&2
- echo "Building '${option_port}' ... [ERROR] (failed to calculate dependencies) maintainers: $(get-maintainers "${option_port}")." >> "$log_subports_progress"
+ echo "Calculating dependencies for '$port' failed, aborting." >&2
+ echo "Building '$port' ... [ERROR] (failed to calculate dependencies) maintainers: $(get-maintainers "$port")." >> "$log_subports_progress"
return 1
fi
if [ -z "$dependencies" ]; then
- echo "'${option_port}' has no dependencies, continuing." >&2
+ echo "'$port' has no dependencies, continuing." >&2
return 0
fi
dependencies_count=$(echo "$dependencies" | wc -l | sed 's/ *//g')
dependencies_counter=1
- echo "Installing $dependencies_count dependencies of $option_port:" | tee -a "$log_status_dependencies"
+ echo "Installing $dependencies_count dependencies of $port:" | tee -a "$log_status_dependencies"
echo "$dependencies" | sed -E 's/^/ - /' | tee -a "$log_status_dependencies"
echo >> "$log_status_dependencies"
@@ -72,7 +72,7 @@
if ! "${option_prefix}/bin/port" -d install --unrequested "$depname" $depvariants ${option_variants}; then
echo "Build of dependency '${depname}' failed, aborting." >&2
echo "[FAIL]" >> "$log_status_dependencies"
- echo "Building '${option_port}' ... [ERROR] (failed to install dependency '${depname}') maintainers: $(get-maintainers "${option_port}" "${depname}")." >> "$log_subports_progress"
+ echo "Building '$port' ... [ERROR] (failed to install dependency '${depname}') maintainers: $(get-maintainers "$port" "${depname}")." >> "$log_subports_progress"
return 1
else
echo "[OK]" >> "$log_status_dependencies"
Modified: contrib/mp-buildbot/mpbb-install-port
===================================================================
--- contrib/mp-buildbot/mpbb-install-port 2016-08-30 19:46:41 UTC (rev 152161)
+++ contrib/mp-buildbot/mpbb-install-port 2016-08-30 20:50:45 UTC (rev 152162)
@@ -19,6 +19,11 @@
}
install-port() {
+ local port=${1-${option_port-}}
+ if [[ -z $port ]]; then
+ err "Must specify a port"
+ return 1
+ fi
# $option_logdir is set in mpbb
# shellcheck disable=SC2154
local log_port_contents="${option_logdir}/port-contents.txt"
@@ -26,11 +31,6 @@
local log_port_main="${option_logdir}/main.log"
local log_subports_progress="${option_logdir}/ports-progress.txt"
- if [ -z "${option_port:-}" ]; then
- err "--port is required"
- return 1
- fi
-
# prepare the log files and make sure to start with empty ones
mkdir -p "${option_logdir}"
#> "$log_port_contents"
@@ -41,19 +41,19 @@
time_start=$(date +%s)
# $option_prefix is set in mpbb
# shellcheck disable=SC2154
- if ! "${option_prefix}/bin/port" -dk install "${option_port}" ${option_variants}; then
- echo "Build of '${option_port}' failed."
+ if ! "${option_prefix}/bin/port" -dk install "$port" ${option_variants}; then
+ echo "Build of '$port' failed."
# log: summary for the portwatcher
- echo "Building '${option_port}' ... [ERROR] maintainers: $(get-maintainers "${option_port}")." >> "$log_subports_progress"
+ echo "Building '$port' ... [ERROR] maintainers: $(get-maintainers "$port")." >> "$log_subports_progress"
return 1
fi
time_stop=$(date +%s)
# log: summary for the portwatcher
- echo "Building '${option_port}' ... [OK]" >> "$log_subports_progress"
+ echo "Building '$port' ... [OK]" >> "$log_subports_progress"
# log: contents
- "${option_prefix}/bin/port" -q contents "${option_port}" > "$log_port_contents"
+ "${option_prefix}/bin/port" -q contents "$port" > "$log_port_contents"
# TODO: printing statistics (and installing the port + dependencies)
# only makes sense when the port hasn't been installed previously
@@ -66,7 +66,7 @@
local print_arg_workdir="ERROR"
local print_arg_destdir="ERROR"
# First, compute port_workdir_size and port_destdir_size
- port_workdir=$("${option_prefix}/bin/port" work "${option_port}")
+ port_workdir=$("${option_prefix}/bin/port" work "$port")
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
@@ -74,7 +74,7 @@
fi
local port_destdir="$port_workdir/destroot"
- # if we arrive here, 'port work $option_port' was successful, so we're
+ # if we arrive here, 'port work $port' was successful, so we're
# at least going to print 'destdir: -'
print_arg_destdir="-"
if [ -d "$port_destdir" ]; then
@@ -91,7 +91,7 @@
# log: main.log
local port_mainlog
- port_mainlog=$("${option_prefix}/bin/port" logfile "${option_port}")
+ port_mainlog=$("${option_prefix}/bin/port" logfile "$port")
if [ $? -eq 0 ] && [ -f "$port_mainlog" ]; then
cp -f "$port_mainlog" "$log_port_main"
fi
Modified: contrib/mp-buildbot/mpbb-list-subports
===================================================================
--- contrib/mp-buildbot/mpbb-list-subports 2016-08-30 19:46:41 UTC (rev 152161)
+++ contrib/mp-buildbot/mpbb-list-subports 2016-08-30 20:50:45 UTC (rev 152162)
@@ -74,7 +74,7 @@
local log_subports_progress="${option_logdir}/ports-progress.txt"
if [ $# -le 0 ] && [ -z "${option_port:-}" ]; then
- err "Either --port or a list of positional arguments with port names is required."
+ err "Must specify at least one port"
return 1
fi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20160830/8015466e/attachment.html>
More information about the macports-changes
mailing list