summaryrefslogtreecommitdiffstats
path: root/perl-install/printer/detect.pm
diff options
context:
space:
mode:
authorTill Kamppeter <tkamppeter@mandriva.com>2004-02-17 13:58:09 +0000
committerTill Kamppeter <tkamppeter@mandriva.com>2004-02-17 13:58:09 +0000
commit9c72b925b2942e1e5201f99f5c6eb5fa6329942d (patch)
tree48da41151fc30fd8d44f21c7b21db1675b3936ce /perl-install/printer/detect.pm
parent77565d50479b2f99ac6822409cc0e8b90e1c1a01 (diff)
downloaddrakx-backup-do-not-use-9c72b925b2942e1e5201f99f5c6eb5fa6329942d.tar
drakx-backup-do-not-use-9c72b925b2942e1e5201f99f5c6eb5fa6329942d.tar.gz
drakx-backup-do-not-use-9c72b925b2942e1e5201f99f5c6eb5fa6329942d.tar.bz2
drakx-backup-do-not-use-9c72b925b2942e1e5201f99f5c6eb5fa6329942d.tar.xz
drakx-backup-do-not-use-9c72b925b2942e1e5201f99f5c6eb5fa6329942d.zip
Fixed problem that not used parallel ports were detected as printers.
Diffstat (limited to 'perl-install/printer/detect.pm')
-rw-r--r--perl-install/printer/detect.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/perl-install/printer/detect.pm b/perl-install/printer/detect.pm
index 038fe5006..ba7e2f1ac 100644
--- a/perl-install/printer/detect.pm
+++ b/perl-install/printer/detect.pm
@@ -40,15 +40,18 @@ sub whatParport() {
open $F, "/proc/parport/$_/autoprobe" or open $F, "/proc/sys/dev/parport/parport$_/autoprobe" or next;
{
local $_;
+ my $itemfound = 0;
while (<$F>) {
if (/(.*):(.*);/) { #-#
$elem->{$1} = $2;
$elem->{$1} =~ s/Hewlett[-\s_]Packard/HP/;
$elem->{$1} =~ s/HEWLETT[-\s_]PACKARD/HP/;
+ $itemfound = 1;
}
}
# Some parallel printers miss the "CLASS" field
- $elem->{CLASS} = 'PRINTER' if !defined($elem->{CLASS});
+ $elem->{CLASS} = 'PRINTER'
+ if $itemfound && !defined($elem->{CLASS});
}
push @res, { port => "/dev/lp$_", val => $elem };
}