summaryrefslogtreecommitdiffstats
path: root/perl-install/install_any.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2002-08-21 20:43:06 +0000
committerPascal Rigaux <pixel@mandriva.com>2002-08-21 20:43:06 +0000
commit48df454d604810ab006d7f3ce1b545c83df1e540 (patch)
tree1dca910aee1523e4fdfdc3a56020123414ede71f /perl-install/install_any.pm
parente15e62ac8668e3538ef9bdc9cc5193c5debb1af4 (diff)
downloaddrakx-backup-do-not-use-48df454d604810ab006d7f3ce1b545c83df1e540.tar
drakx-backup-do-not-use-48df454d604810ab006d7f3ce1b545c83df1e540.tar.gz
drakx-backup-do-not-use-48df454d604810ab006d7f3ce1b545c83df1e540.tar.bz2
drakx-backup-do-not-use-48df454d604810ab006d7f3ce1b545c83df1e540.tar.xz
drakx-backup-do-not-use-48df454d604810ab006d7f3ce1b545c83df1e540.zip
- add do_pkgs->are_installed
- add an auto parameter to ensure_is_installed - implement do_pkgs->ensure_is_installed during install
Diffstat (limited to 'perl-install/install_any.pm')
-rw-r--r--perl-install/install_any.pm23
1 files changed, 23 insertions, 0 deletions
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm
index c5abc334b..8edbe0573 100644
--- a/perl-install/install_any.pm
+++ b/perl-install/install_any.pm
@@ -1173,6 +1173,21 @@ sub install {
$do->{o}->pkg_install(@l);
}
+sub ensure_is_installed {
+ my ($do, $pkg, $file, $auto) = @_;
+
+ if (! -e $file) {
+ $do->{o}->ask_okcancel('', _("The package %s needs to be installed. Do you want to install it?", $pkg), 1)
+ or return if !$auto;
+ $do->{o}->do_pkgs->install($pkg);
+ }
+ if (! -e $file) {
+ $do->{o}->ask_warn('', _("Mandatory package %s is missing", $pkg));
+ return;
+ }
+ 1;
+}
+
sub what_provides {
my ($do, $name) = @_;
map { $do->{o}{packages}{depslist}[$_]->name } keys %{$do->{o}{packages}{provides}{$name} || {}};
@@ -1187,6 +1202,14 @@ sub is_installed {
1;
}
+sub are_installed {
+ my ($do, @l) = @_;
+ grep {
+ my $p = pkgs::packageByName($do->{o}{packages}, $_);
+ $p && $p->flag_selected;
+ } @l;
+}
+
sub remove {
my ($do, @l) = @_;