diff options
author | Till Kamppeter <tkamppeter@mandriva.com> | 2002-02-01 17:41:59 +0000 |
---|---|---|
committer | Till Kamppeter <tkamppeter@mandriva.com> | 2002-02-01 17:41:59 +0000 |
commit | affb4cb38f8b877e59274e5f958a25dce7acdbb7 (patch) | |
tree | ebb8308f20d4de6540fbf8cdeae2d15209014cbd /perl-install | |
parent | 0aba1dc443b076e7897081940e8b09e7966398b7 (diff) | |
download | drakx-affb4cb38f8b877e59274e5f958a25dce7acdbb7.tar drakx-affb4cb38f8b877e59274e5f958a25dce7acdbb7.tar.gz drakx-affb4cb38f8b877e59274e5f958a25dce7acdbb7.tar.bz2 drakx-affb4cb38f8b877e59274e5f958a25dce7acdbb7.tar.xz drakx-affb4cb38f8b877e59274e5f958a25dce7acdbb7.zip |
Made auto-detection working for HP DeskJet 840C on USB
General improvements for reliability of USB printer auto-detection
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/detect_devices.pm | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm index 1c1accd0e..a512efd49 100644 --- a/perl-install/detect_devices.pm +++ b/perl-install/detect_devices.pm @@ -414,27 +414,38 @@ sub whatUsbport() { $idstr =~ tr/[\x00-\x1f]/\./; # Extract the printer data from the ID string my ($manufacturer, $model, $description) = ("", "", ""); - if ($idstr =~ /MFG:([^;]+);/) { + if (($idstr =~ /MFG:([^;]+);/) || + ($idstr =~ /MANUFACTURER:([^;]+);/)) { $manufacturer = $1; $manufacturer =~ s/Hewlett[-\s_]Packard/HP/; + $manufacturer =~ s/HEWLETT[-\s_]PACKARD/HP/; } - if ($idstr =~ /MDL:([^;]+);/) { + if (($idstr =~ /MDL:([^;]+);/) || + ($idstr =~ /MODEL:([^;]+);/)) { $model = $1; } - if ($idstr =~ /DES:([^;]+);/) { + if (($idstr =~ /DES:([^;]+);/) || + ($idstr =~ /DESCRIPTION:([^;]+);/)) { $description = $1; $description =~ s/Hewlett[-\s_]Packard/HP/; + $description =~ s/HEWLETT[-\s_]PACKARD/HP/; } # Was there a manufacturer and a model in the string? - if (($manufacturer eq "") && ($model eq "")) { + if (($manufacturer eq "") || ($model eq "")) { next; } + # No description field? Make one out of manufacturer and model. + if ($description eq "") { + $description = "$manufacturer $model"; + } + # Store this auto-detection result in the data structure push @res, { port => $port, val => { CLASS => 'PRINTER', MODEL => $model, MANUFACTURER => $manufacturer, DESCRIPTION => $description, }}; } + use Data::Dumper; @res; } |