summaryrefslogtreecommitdiffstats
path: root/perl-install/printer.pm
diff options
context:
space:
mode:
authorTill Kamppeter <tkamppeter@mandriva.com>2001-08-08 17:10:05 +0000
committerTill Kamppeter <tkamppeter@mandriva.com>2001-08-08 17:10:05 +0000
commitad33ed3c54d386eb5360195f88a9bf33359979d4 (patch)
treec865801badf79d3ab1249ed729eae8045db27320 /perl-install/printer.pm
parent1c1f82737073571060111e0130622c1bf05d7db3 (diff)
downloaddrakx-ad33ed3c54d386eb5360195f88a9bf33359979d4.tar
drakx-ad33ed3c54d386eb5360195f88a9bf33359979d4.tar.gz
drakx-ad33ed3c54d386eb5360195f88a9bf33359979d4.tar.bz2
drakx-ad33ed3c54d386eb5360195f88a9bf33359979d4.tar.xz
drakx-ad33ed3c54d386eb5360195f88a9bf33359979d4.zip
Bugfixes on automatic installation of needed packages
Diffstat (limited to 'perl-install/printer.pm')
-rw-r--r--perl-install/printer.pm16
1 files changed, 15 insertions, 1 deletions
diff --git a/perl-install/printer.pm b/perl-install/printer.pm
index dda9dccea..1e4b11d0c 100644
--- a/perl-install/printer.pm
+++ b/perl-install/printer.pm
@@ -107,7 +107,7 @@ sub remove_package ($) {
sub installed ($) {
my ($package) = @_;
- open RPMCHECK, "rpm -qa | grep $package |" ||
+ open RPMCHECK, "rpm -qa --root $prefix/ | grep $package |" ||
die "Could not run rpm!";
my $found = 0;
while (<RPMCHECK>) {
@@ -151,6 +151,8 @@ sub resetinfo($) {
# -check which printing system was used previously and load the information
# -about its queues
read_configured_queues($printer);
+ #my $entry = $printer->{configured}{$printer->{QUEUE}} || (values %{$printer->{configured}})[0];
+ #print "##### $entry->{make} $entry->{model} $entry->{queuedata}{queue}\n";
}
sub read_configured_queues($) {
@@ -189,6 +191,18 @@ sub read_configured_queues($) {
for ($i = 0; $i < $N; $i++) {
$printer->{configured}{$QUEUES[$i]->{'queuedata'}{'queue'}} =
$QUEUES[$i];
+ if ((!$QUEUES[$i]->{'make'}) || (!$QUEUES[$i]->{'model'})) {
+ if ($printer->{SPOOLER} eq "cups") {
+ $printer->{OLD_QUEUE} = $QUEUES[$i]->{'queuedata'}{'queue'};
+ my $descr = get_descr_from_ppd($printer);
+ $descr =~ m/^([^\|]*)\|([^\|]*)\|.*$/;
+ $printer->{configured}{$QUEUES[$i]->{'queuedata'}{'queue'}}{make} ||= $1;
+ $printer->{configured}{$QUEUES[$i]->{'queuedata'}{'queue'}}{model} ||= $2;
+ $printer->{OLD_QUEUE} = "";
+ }
+ $printer->{configured}{$QUEUES[$i]->{'queuedata'}{'queue'}}{make} ||= "";
+ $printer->{configured}{$QUEUES[$i]->{'queuedata'}{'queue'}}{model} ||= __("Unknown model");
+ }
}
}