Files
mpbb/mpbb-install-dependencies
T

44 lines
1.4 KiB
Bash
Raw Normal View History

2016-03-17 08:06:27 +00:00
#!/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
2016-03-17 08:06:27 +00:00
# Note:
2016-08-05 19:06:18 +00:00
# This script is sourced by the mpbb wrapper script.
2016-03-17 08:06:27 +00:00
# Do not execute this directly!
2016-09-12 01:59:04 +00:00
install-dependencies-usage() {
# "prog" is defined in mpbb-help.
# shellcheck disable=SC2154
cat <<EOF
usage: $prog [<global opts>] install-dependencies <port>
2016-03-17 08:06:27 +00:00
2016-09-12 01:59:04 +00:00
Build and install the dependencies of the given port.
Run \`$prog help' for global options and a list of other subcommands.
EOF
2016-03-17 08:06:27 +00:00
}
install-dependencies() {
local port=${1-}
2016-08-30 20:50:45 +00:00
if [[ -z $port ]]; then
err "Must specify a port"
return 1
fi
2016-08-30 21:59:26 +00:00
local log_subports_progress="${option_log_dir}/ports-progress.txt"
2022-01-01 17:54:28 +11:00
local result
2022-01-01 17:54:28 +11:00
# Script attempts to get to a state where all dependencies (and
# only dependencies) of the port are active
# $option_prefix and $thisdir are set in mpbb
# shellcheck disable=SC2154
2025-04-29 22:45:18 +10:00
"${option_prefix}/bin/port-tclsh" "${thisdir}/tools/dependencies.tcl" --failcache_dir "${option_failcache_dir}" \
2022-01-01 17:54:28 +11:00
--logs_dir "${option_log_dir}" "$@"
result=$?
if [ $result -ne 0 ]; then
echo "Processing dependencies for '$port' failed, aborting." >&2
if [ $result -eq 2 ]; then
echo "Building '$port' ... [ERROR] (failed to activate dependencies) maintainers: $(get-maintainers "$port")." >> "$log_subports_progress"
fi
return 1
fi
2016-03-17 08:06:27 +00:00
}