summaryrefslogtreecommitdiffstats
path: root/perl-install/printer.pm
diff options
context:
space:
mode:
authorTill Kamppeter <tkamppeter@mandriva.com>2001-08-07 22:56:55 +0000
committerTill Kamppeter <tkamppeter@mandriva.com>2001-08-07 22:56:55 +0000
commit8a41cf834dda0b87aa1b155c1c6919b7eff8449a (patch)
treee06fae38864204ff540b6e13328fdd6fff38f998 /perl-install/printer.pm
parent9c0685c5dc4a29e204bffe91cb875b91f60170fa (diff)
downloaddrakx-backup-do-not-use-8a41cf834dda0b87aa1b155c1c6919b7eff8449a.tar
drakx-backup-do-not-use-8a41cf834dda0b87aa1b155c1c6919b7eff8449a.tar.gz
drakx-backup-do-not-use-8a41cf834dda0b87aa1b155c1c6919b7eff8449a.tar.bz2
drakx-backup-do-not-use-8a41cf834dda0b87aa1b155c1c6919b7eff8449a.tar.xz
drakx-backup-do-not-use-8a41cf834dda0b87aa1b155c1c6919b7eff8449a.zip
Automatic installation of all needed packages
Diffstat (limited to 'perl-install/printer.pm')
-rw-r--r--perl-install/printer.pm15
1 files changed, 15 insertions, 0 deletions
diff --git a/perl-install/printer.pm b/perl-install/printer.pm
index bf98ddc3d..dda9dccea 100644
--- a/perl-install/printer.pm
+++ b/perl-install/printer.pm
@@ -105,6 +105,21 @@ sub remove_package ($) {
run_program::rooted($prefix, "rpm -e --nodeps $package") || do {};
}
+sub installed ($) {
+ my ($package) = @_;
+ open RPMCHECK, "rpm -qa | grep $package |" ||
+ die "Could not run rpm!";
+ my $found = 0;
+ while (<RPMCHECK>) {
+ if ($_ =~ m/^$package\-.+\-.+mdk/) {
+ $found = 1;
+ last;
+ }
+ }
+ close RPMCHECK;
+ return $found;
+}
+
sub copy_printer_params($$) {
my ($from, $to) = @_;
map { $to->{$_} = $from->{$_} } grep { $_ ne 'configured' } keys %$from;