summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2001-08-08 17:24:32 +0000
committerPascal Rigaux <pixel@mandriva.com>2001-08-08 17:24:32 +0000
commitb7b8f8fc3b3b95817c77f376065b8ce705f8d4d9 (patch)
treef37eb8d584cf9f1ced1b9eb7f7ddc61b9c7de1d4 /perl-install/standalone.pm
parent75fb7f43f2ca90a9121df1e572ea77ae4a27dcd4 (diff)
downloaddrakx-backup-do-not-use-b7b8f8fc3b3b95817c77f376065b8ce705f8d4d9.tar
drakx-backup-do-not-use-b7b8f8fc3b3b95817c77f376065b8ce705f8d4d9.tar.gz
drakx-backup-do-not-use-b7b8f8fc3b3b95817c77f376065b8ce705f8d4d9.tar.bz2
drakx-backup-do-not-use-b7b8f8fc3b3b95817c77f376065b8ce705f8d4d9.tar.xz
drakx-backup-do-not-use-b7b8f8fc3b3b95817c77f376065b8ce705f8d4d9.zip
adding interactive_pkgs stuff
Diffstat (limited to 'perl-install/standalone.pm')
-rw-r--r--perl-install/standalone.pm33
1 files changed, 28 insertions, 5 deletions
diff --git a/perl-install/standalone.pm b/perl-install/standalone.pm
index b74253f72..408088b33 100644
--- a/perl-install/standalone.pm
+++ b/perl-install/standalone.pm
@@ -10,11 +10,34 @@ c::setlocale();
c::bindtextdomain('libDrakX', "/usr/share/locale");
-sub pkgs_install {
- my ($in, @l) = @_;
- $in->suspend;
- my $ret = system('urpmi --auto --best-output ' . join(' ', @l));
- $in->resume;
+
+package interactive_pkgs;
+
+sub interactive::do_pkgs {
+ my ($in) = @_;
+ bless { in => $in }, 'interactive_pkgs';
+}
+
+sub install {
+ my ($o, @l) = @_;
+ $o->{in}->suspend;
+ my $ret = system('urpmi', '--auto', '--best-output', @l);
+ $o->{in}->resume;
+ $ret;
+}
+
+sub install_if {
+ my ($o, $deps, @l) = @_;
+ my @deps = deref($deps);
+ system('rpm', '-q', @deps) == 0 or return;
+ install($o, @l);
+}
+
+sub remove {
+ my ($o, @l) = @_;
+ $o->{in}->suspend;
+ my $ret = system('rpm', '-e ', @l);
+ $o->{in}->resume;
$ret;
}