summaryrefslogtreecommitdiffstats
path: root/perl-install/printer.pm
diff options
context:
space:
mode:
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;