summaryrefslogtreecommitdiffstats
path: root/perl-install/do_pkgs.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-08-02 06:52:22 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-08-02 06:52:22 +0000
commitdb02946e5f58e282d5056a57d50208022f2fc796 (patch)
tree7755a8abb9c238d4e6405c546c516a7e2458114c /perl-install/do_pkgs.pm
parent16c8467a9f303721a889bf4248ae02ad178fa471 (diff)
downloaddrakx-db02946e5f58e282d5056a57d50208022f2fc796.tar
drakx-db02946e5f58e282d5056a57d50208022f2fc796.tar.gz
drakx-db02946e5f58e282d5056a57d50208022f2fc796.tar.bz2
drakx-db02946e5f58e282d5056a57d50208022f2fc796.tar.xz
drakx-db02946e5f58e282d5056a57d50208022f2fc796.zip
introduce ->ensure_binary_is_installed and use it
Diffstat (limited to 'perl-install/do_pkgs.pm')
-rw-r--r--perl-install/do_pkgs.pm15
1 files changed, 15 insertions, 0 deletions
diff --git a/perl-install/do_pkgs.pm b/perl-install/do_pkgs.pm
index 005e61c9a..f0feda785 100644
--- a/perl-install/do_pkgs.pm
+++ b/perl-install/do_pkgs.pm
@@ -24,6 +24,21 @@ sub ensure_is_installed {
1;
}
+sub ensure_binary_is_installed {
+ my ($do, $pkg, $binary, $b_auto) = @_;
+
+ if (!whereis_binary($binary, $::prefix)) {
+ $do->in->ask_okcancel('', N("The package %s needs to be installed. Do you want to install it?", $pkg), 1)
+ or return if !$b_auto;
+ $do->install($pkg) or return;
+ }
+ if (!whereis_binary($binary, $::prefix)) {
+ $do->in->ask_warn('', N("Mandatory package %s is missing", $pkg));
+ return;
+ }
+ 1;
+}
+
sub ensure_is_installed_if_available {
my ($do, $pkg, $file) = @_;
if (! -e "$::prefix$file" && !$::testing) {