summaryrefslogtreecommitdiffstats
path: root/perl-install/printer
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-02-02 19:26:34 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-02-02 19:26:34 +0000
commit65693d70b34cb6c9983253d3eba5a345587f04a4 (patch)
tree07ee895a16bab3697096fedd5312c9360aa16ccc /perl-install/printer
parentcea0dde9a2c5b0c5f69ed4ebb9ed2a0e1e6bfbd8 (diff)
downloaddrakx-backup-do-not-use-65693d70b34cb6c9983253d3eba5a345587f04a4.tar
drakx-backup-do-not-use-65693d70b34cb6c9983253d3eba5a345587f04a4.tar.gz
drakx-backup-do-not-use-65693d70b34cb6c9983253d3eba5a345587f04a4.tar.bz2
drakx-backup-do-not-use-65693d70b34cb6c9983253d3eba5a345587f04a4.tar.xz
drakx-backup-do-not-use-65693d70b34cb6c9983253d3eba5a345587f04a4.zip
move whatParport() to printer::detect
Diffstat (limited to 'perl-install/printer')
-rw-r--r--perl-install/printer/detect.pm21
1 files changed, 21 insertions, 0 deletions
diff --git a/perl-install/printer/detect.pm b/perl-install/printer/detect.pm
index 5c3a4fe1e..5a4c3e1f8 100644
--- a/perl-install/printer/detect.pm
+++ b/perl-install/printer/detect.pm
@@ -31,6 +31,27 @@ sub whatPrinter {
grep { $_->{val}{CLASS} eq "PRINTER" } @res;
}
+sub whatParport() {
+ my @res;
+ foreach (0..3) {
+ my $elem = {};
+ my $F;
+ open $F, "/proc/parport/$_/autoprobe" or open $F, "/proc/sys/dev/parport/parport$_/autoprobe" or next;
+ {
+ local $_;
+ while (<$F>) {
+ if (/(.*):(.*);/) { #-#
+ $elem->{$1} = $2;
+ $elem->{$1} =~ s/Hewlett[-\s_]Packard/HP/;
+ $elem->{$1} =~ s/HEWLETT[-\s_]PACKARD/HP/;
+ }
+ }
+ }
+ push @res, { port => "/dev/lp$_", val => $elem };
+ }
+ @res;
+}
+
sub whatPrinterPort() {
grep { tryWrite($_) } qw(/dev/lp0 /dev/lp1 /dev/lp2 /dev/usb/lp0 /dev/usb/lp1 /dev/usb/lp2 /dev/usb/lp3 /dev/usb/lp4 /dev/usb/lp5 /dev/usb/lp6 /dev/usb/lp7 /dev/usb/lp8 /dev/usb/lp9);
}