diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2002-08-13 21:08:48 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2002-08-13 21:08:48 +0000 |
commit | 26f4283dcfbdcb5305c3e7181c6ae82284d47c02 (patch) | |
tree | e2ce97fe27ef2191a5b7378405a1c8c4c8818e90 /perl-install/standalone.pm | |
parent | f13b0c38b9b1c794f803ed3f496e076924cde03a (diff) | |
download | drakx-26f4283dcfbdcb5305c3e7181c6ae82284d47c02.tar drakx-26f4283dcfbdcb5305c3e7181c6ae82284d47c02.tar.gz drakx-26f4283dcfbdcb5305c3e7181c6ae82284d47c02.tar.bz2 drakx-26f4283dcfbdcb5305c3e7181c6ae82284d47c02.tar.xz drakx-26f4283dcfbdcb5305c3e7181c6ae82284d47c02.zip |
add ensure_is_installed (which was network::smbnfs::check_raw and is often useful)
Diffstat (limited to 'perl-install/standalone.pm')
-rw-r--r-- | perl-install/standalone.pm | 14 |
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`; |