summaryrefslogtreecommitdiffstats
path: root/perl-install/do_pkgs.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/do_pkgs.pm')
-rw-r--r--perl-install/do_pkgs.pm8
1 files changed, 6 insertions, 2 deletions
diff --git a/perl-install/do_pkgs.pm b/perl-install/do_pkgs.pm
index a6e4c4a26..bc2196c3a 100644
--- a/perl-install/do_pkgs.pm
+++ b/perl-install/do_pkgs.pm
@@ -12,14 +12,18 @@ use common;
sub ensure_is_installed {
my ($do, $pkg, $o_file, $b_auto) = @_;
- if (! $o_file || ! -e "$::prefix$o_file") {
+ if ($o_file ? -e "$::prefix$o_file" : $do->is_installed($pkg)) {
+ return 1;
+ }
+
$do->in->ask_okcancel(N("Warning"), N("The package %s needs to be installed. Do you want to install it?", $pkg), 1)
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)) if $do->in;
return;
}
- }
+
if ($o_file && ! -e "$::prefix$o_file") {
$do->in->ask_warn(N("Error"), N("Mandatory package %s is missing", $pkg)) if $do->in;
return;