-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
mpbb-install-dependencies
44 lines (38 loc) · 1.51 KB
/
mpbb-install-dependencies
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/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!
install-dependencies-usage() {
# "prog" is defined in mpbb-help.
# shellcheck disable=SC2154
cat <<EOF
usage: $prog [<global opts>] install-dependencies <port>
Build and install the dependencies of the given port.
Run \`$prog help' for global options and a list of other subcommands.
EOF
}
install-dependencies() {
local port=${1-}
if [[ -z $port ]]; then
err "Must specify a port"
return 1
fi
local log_subports_progress="${option_log_dir}/ports-progress.txt"
local result
# Script attempts to get to a state where all dependencies (and
# only dependencies) of the port are active
# Use of readlink is due to https://trac.macports.org/ticket/64507
# $option_prefix and $thisdir are set in mpbb
# shellcheck disable=SC2154
"$(readlink "${option_prefix}/bin/port-tclsh")" "${thisdir}/tools/dependencies.tcl" --failcache_dir "${option_failcache_dir}" \
--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
}