summaryrefslogtreecommitdiffstats
path: root/perl-install/detect_devices.pm
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>1999-11-16 15:54:57 +0000
committerFrancois Pons <fpons@mandriva.com>1999-11-16 15:54:57 +0000
commitc34d56dace9c34ca9986d75e462aa8395f546ece (patch)
treed1aee35e02d9ca3a7a8b3f86d8715856c705cb81 /perl-install/detect_devices.pm
parent68446bf48bc000cf485267ce0419d2d3f7caec5a (diff)
downloaddrakx-backup-do-not-use-c34d56dace9c34ca9986d75e462aa8395f546ece.tar
drakx-backup-do-not-use-c34d56dace9c34ca9986d75e462aa8395f546ece.tar.gz
drakx-backup-do-not-use-c34d56dace9c34ca9986d75e462aa8395f546ece.tar.bz2
drakx-backup-do-not-use-c34d56dace9c34ca9986d75e462aa8395f546ece.tar.xz
drakx-backup-do-not-use-c34d56dace9c34ca9986d75e462aa8395f546ece.zip
*** empty log message ***
Diffstat (limited to 'perl-install/detect_devices.pm')
-rw-r--r--perl-install/detect_devices.pm19
1 files changed, 15 insertions, 4 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index a7fe2ed86..a6ce0575b 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -206,12 +206,23 @@ sub whatPrinterPort() {
grep { tryWrite($_)} qw(/dev/lp0 /dev/lp1 /dev/lp2);
}
-sub hasModem($) {
- my ($device) = @_;
+sub probe_device($) {
+ my $device = devices::make($_[0]);
my %probe;
- local *F; open F, "pnp_serial $device |";
+
+ #- TODO cache hash result of probe according to device.
+ local *F;
+ open F, "pnp_serial $device 2>/dev/null |" if $device =~ /ttyS/;
+
foreach (<F>) { $probe{$1} = $2 if /^\s+(.*?)\s*:\s*\"(.*)\"\s*$/ }
- $probe{CLASS} =~ /Modem/i && $probe{DESCRIPTION};
+ log::l("probing $device find class: $probe{CLASS}");
+
+ \%probe;
+}
+
+sub hasModem($) {
+ my $probe = probe_device($_[0]);
+ $probe->{CLASS} =~ /MODEM/i && $probe->{DESCRIPTION};
}
sub hasMousePS2() {