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.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) {