summaryrefslogtreecommitdiff
path: root/bin/ct
diff options
context:
space:
mode:
Diffstat (limited to 'bin/ct')
-rwxr-xr-xbin/ct18
1 files changed, 17 insertions, 1 deletions
diff --git a/bin/ct b/bin/ct
index 1403073..e90ea5e 100755
--- a/bin/ct
+++ b/bin/ct
@@ -473,7 +473,7 @@ function global_hook {
}
function check_prereqs {
- typeset -a -U install maybe_install
+ typeset -a -U force_install install maybe_install
typeset warn info
typeset package=$1
@@ -497,6 +497,15 @@ function check_prereqs {
install+=$1
}
+
+ function force_depend {
+ if [[ $1 == 'package' ]] {
+ is_installed $2 || force_install+=$2
+ } else {
+ warn "force_depend: Only makes sense for packages\n"
+ }
+ }
+
function depend {
if [[ $1 == 'package' ]] {
is_installed $2 || offer_install $2
@@ -539,6 +548,13 @@ function check_prereqs {
read -q '?continue [] '
}
+ if [[ -n $force_install ]] {
+ info "${1} forces installation of additional packages: ${(j:, :)force_install}\n"
+ for package in ${force_install}; {
+ pkg_add ${package}
+ }
+ }
+
if [[ -n $install ]] {
info "$1 requires the following packages: ${(j:, :)install}\n"
if confirm_yes "Install them?"; then