diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2005-09-27 09:37:22 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2005-09-27 09:37:22 +0000 |
commit | df587e7ed6c3f327c6a3b851148d337e99bfeda3 (patch) | |
tree | 7dee69a5a46c43fe6be09a0bb6d7346f5a5ea81a /perl-install/do_pkgs.pm | |
parent | d8d406fcac31376ee209bf47b4dc0be6331f81d7 (diff) | |
download | drakx-df587e7ed6c3f327c6a3b851148d337e99bfeda3.tar drakx-df587e7ed6c3f327c6a3b851148d337e99bfeda3.tar.gz drakx-df587e7ed6c3f327c6a3b851148d337e99bfeda3.tar.bz2 drakx-df587e7ed6c3f327c6a3b851148d337e99bfeda3.tar.xz drakx-df587e7ed6c3f327c6a3b851148d337e99bfeda3.zip |
ensure we don't prompt things when we are not interactive
Diffstat (limited to 'perl-install/do_pkgs.pm')
-rw-r--r-- | perl-install/do_pkgs.pm | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/perl-install/do_pkgs.pm b/perl-install/do_pkgs.pm index 4d1464bc2..73fa466d1 100644 --- a/perl-install/do_pkgs.pm +++ b/perl-install/do_pkgs.pm @@ -14,7 +14,7 @@ sub ensure_is_installed { if (! $o_file || ! -e "$::prefix$o_file") { $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; + or return if !$b_auto && $do->in; if (!$do->install($pkg)) { $do->in->ask_warn(N("Error"), N("Could not install the %s package!", $pkg)); return; @@ -33,7 +33,7 @@ sub ensure_are_installed { my @not_installed = difference2($pkgs, [ $do->are_installed(@$pkgs) ]) or return 1; $do->in->ask_okcancel(N("Warning"), N("The following packages need to be installed:\n") . join(', ', @not_installed), 1) - or return if !$b_auto; + or return if !$b_auto && $do->in; if (!$do->install(@not_installed)) { $do->in->ask_warn(N("Error"), N("Could not install the %s package!", $not_installed[0])); @@ -47,7 +47,7 @@ sub ensure_binary_is_installed { 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; + or return if !$b_auto && $do->in; if (!$do->install($pkg)) { $do->in->ask_warn(N("Error"), N("Could not install the %s package!", $pkg)); return; @@ -104,6 +104,9 @@ our @ISA = qw(do_pkgs_common); sub new { my ($type, $in) = @_; + + $in->isa('interactive') or undef $in; + require pkgs; bless { in => $in, o => $::o }, $type; } |