summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/standalone.pm')
-rw-r--r--perl-install/standalone.pm14
1 files changed, 14 insertions, 0 deletions
diff --git a/perl-install/standalone.pm b/perl-install/standalone.pm
index e6142fcbe..54205dc7b 100644
--- a/perl-install/standalone.pm
+++ b/perl-install/standalone.pm
@@ -50,6 +50,20 @@ sub install {
$ret;
}
+sub ensure_is_installed {
+ my ($o, $pkg, $file) = @_;
+
+ if (! -e $file) {
+ $o->{in}->ask_okcancel('', _("The package %s needs to be installed. Do you want to install it?", $pkg), 1) or return;
+ $o->{in}->do_pkgs->install($pkg);
+ }
+ if (! -e $file) {
+ $o->{in}->ask_warn('', _("Mandatory package %s is missing", $pkg));
+ return;
+ }
+ 1;
+}
+
sub what_provides {
my ($o, $name) = @_;
my ($what) = split '\n', `urpmq '$name' 2>/dev/null`;