diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2010-04-20 19:31:51 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2010-04-20 19:31:51 +0200 |
commit | e7e98a5f171e8698b5b90f2ec79b6aa390ac0d0a (patch) | |
tree | bec381c8b64ee241484e5ee7def0aca0c60edda7 /bin | |
parent | 3e95ef30eee0176244b04dba8e394c95a1adadd2 (diff) |
Add "force_depend" prereqs directive
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ct | 18 |
1 files changed, 17 insertions, 1 deletions
@@ -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 |