summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTill Kamppeter <tkamppeter@mandriva.com>2002-07-26 00:22:24 +0000
committerTill Kamppeter <tkamppeter@mandriva.com>2002-07-26 00:22:24 +0000
commitd5d88c3015a1f1614c0ebb007b25db4370e2da5a (patch)
tree60d08f529d22950a9abbf5d89c6a87e427dd9cee
parenta4a75127b56e1e352356c0d3401007c18e4d27dd (diff)
downloaddrakx-backup-do-not-use-d5d88c3015a1f1614c0ebb007b25db4370e2da5a.tar
drakx-backup-do-not-use-d5d88c3015a1f1614c0ebb007b25db4370e2da5a.tar.gz
drakx-backup-do-not-use-d5d88c3015a1f1614c0ebb007b25db4370e2da5a.tar.bz2
drakx-backup-do-not-use-d5d88c3015a1f1614c0ebb007b25db4370e2da5a.tar.xz
drakx-backup-do-not-use-d5d88c3015a1f1614c0ebb007b25db4370e2da5a.zip
Added detection of trhe serial number of a USB printer (in preparation for HPOJ 0.9 support in printerdrake).
-rw-r--r--perl-install/detect_devices.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index 235e4945d..b4eef5ec6 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -528,7 +528,8 @@ sub whatUsbport() {
# Remove non-printable characters
$idstr =~ tr/[\x00-\x1f]/\./;
# Extract the printer data from the ID string
- my ($manufacturer, $model, $description) = ("", "", "");
+ my ($manufacturer, $model, $serialnumber, $description) =
+ ("", "", "", "");
if (($idstr =~ /MFG:([^;]+);/) ||
($idstr =~ /MANUFACTURER:([^;]+);/)) {
$manufacturer = $1;
@@ -545,6 +546,9 @@ sub whatUsbport() {
$description =~ s/Hewlett[-\s_]Packard/HP/;
$description =~ s/HEWLETT[-\s_]PACKARD/HP/;
}
+ if ($idstr =~ /SE*R*N:([^;]+);/) {
+ $serialnumber = $1;
+ }
# Was there a manufacturer and a model in the string?
if (($manufacturer eq "") || ($model eq "")) {
next;
@@ -559,6 +563,7 @@ sub whatUsbport() {
MODEL => $model,
MANUFACTURER => $manufacturer,
DESCRIPTION => $description,
+ SERIALNUMBER => $serialnumber
}};
}
@res;