diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2001-08-08 18:26:31 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2001-08-08 18:26:31 +0000 |
commit | 157fe13a76e798fa8af5f79c792c704a593f6c93 (patch) | |
tree | 7dded9e6761033f09709722965d15b14ce7825bd /perl-install/install_any.pm | |
parent | b4fd82d0ced6a2118a51b060d2eff8c4f179b52b (diff) | |
download | drakx-157fe13a76e798fa8af5f79c792c704a593f6c93.tar drakx-157fe13a76e798fa8af5f79c792c704a593f6c93.tar.gz drakx-157fe13a76e798fa8af5f79c792c704a593f6c93.tar.bz2 drakx-157fe13a76e798fa8af5f79c792c704a593f6c93.tar.xz drakx-157fe13a76e798fa8af5f79c792c704a593f6c93.zip |
add interactive_pkgs stuff
Diffstat (limited to 'perl-install/install_any.pm')
-rw-r--r-- | perl-install/install_any.pm | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/perl-install/install_any.pm b/perl-install/install_any.pm index b76941b94..5babb5bd5 100644 --- a/perl-install/install_any.pm +++ b/perl-install/install_any.pm @@ -959,4 +959,55 @@ sub remove_bigseldom_used { ); } + +################################################################################ +package interactive_pkgs; +use run_program; +use common; +use pkgs; + +sub interactive::do_pkgs { + my ($o) = @_; + bless { o => $o }, 'interactive_pkgs'; +} + +sub install { + my ($do, @l) = @_; + $do->{o}->pkg_install(@l); +} + +sub is_installed { + my ($do, @l) = @_; + foreach (@l) { + my $p = pkgs::packageByName($do->{o}->{packages}, $_); + $p && pkgs::packageFlagSelected($p) or return; + } + 1; +} + +sub remove { + my ($do, @l) = @_; + + @l = grep { + my $p = pkgs::packageByName($do->{o}->{packages}, $_); + pkgs::unselectPackage($do->{o}->{packages}, $p) if $p; + $p; + } + run_program::rooted($do->{o}->{prefix}, 'rpm', '-e', @l); +} + +sub remove_nodeps { + my ($do, @l) = @_; + + @l = grep { + my $p = pkgs::packageByName($do->{o}->{packages}, $_); + pkgs::packageSetFlagSelected($p, 0) if $p; + $p; + } + run_program::rooted($do->{o}->{prefix}, 'rpm', '-e', '--nodeps', @l); +} +################################################################################ + +package install_any; + 1; |