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.

git-svn-id: https://svn.macports.org/repository/macports/contrib/mp-buildbot@152162 d073be05-634f-4543-b044-5fe20cf6d1d6
This commit is contained in:
Lawrence Velázquez
2016-08-30 20:50:45 +00:00
parent 6780325428
commit ce112d3641
5 changed files with 30 additions and 41 deletions
+4 -12
View File
@@ -27,25 +27,19 @@ The defined build steps are:
--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
...or for several.
mpbb list-subports --prefix /opt/local cmake llvm-3.8 ...
mpbb list-subports --prefix /opt/local php 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 @@ Subcommand scripts may use but not modify these global shell parameters:
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`:
+1 -4
View File
@@ -52,10 +52,6 @@ OPTIONS
--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 @@ while [[ $# -gt 0 ]]; do
option_help=1
;;
--port)
# Deprecated and will be removed in the near future.
option_port=$2
shift
;;
+11 -11
View File
@@ -19,6 +19,11 @@ get-maintainers() {
}
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 @@ install-dependencies() {
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 @@ install-dependencies() {
# 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 @@ install-dependencies() {
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"
+13 -13
View File
@@ -19,6 +19,11 @@ get-maintainers() {
}
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 @@ install-port() {
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 @@ install-port() {
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 @@ install-port() {
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 @@ install-port() {
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 @@ install-port() {
# 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
+1 -1
View File
@@ -74,7 +74,7 @@ list-subports() {
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