summaryrefslogtreecommitdiff
path: root/bin/ct
diff options
context:
space:
mode:
authorDaniel Friesel <derf@derf.homelinux.org>2010-04-20 19:31:51 +0200
committerDaniel Friesel <derf@derf.homelinux.org>2010-04-20 19:31:51 +0200
commite7e98a5f171e8698b5b90f2ec79b6aa390ac0d0a (patch)
treebec381c8b64ee241484e5ee7def0aca0c60edda7 /bin/ct
parent3e95ef30eee0176244b04dba8e394c95a1adadd2 (diff)
Add "force_depend" prereqs directive
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