diff options
Diffstat (limited to 'perl-install/do_pkgs.pm')
-rw-r--r-- | perl-install/do_pkgs.pm | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/perl-install/do_pkgs.pm b/perl-install/do_pkgs.pm index cd0c4b40a..c98019062 100644 --- a/perl-install/do_pkgs.pm +++ b/perl-install/do_pkgs.pm @@ -27,6 +27,21 @@ sub ensure_is_installed { 1; } +sub ensure_are_installed { + my ($do, $pkgs, $b_auto) = @_; + + 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; + + if (!$do->install(@not_installed)) { + $do->in->ask_warn(N("Error"), N("Could not install the %s package!", $not_installed[0])); + return; + } + 1; +} + sub ensure_binary_is_installed { my ($do, $pkg, $binary, $b_auto) = @_; |