summaryrefslogtreecommitdiffstats
path: root/perl-install/detect_devices.pm
diff options
context:
space:
mode:
authorTill Kamppeter <tkamppeter@mandriva.com>2003-01-20 02:48:22 +0000
committerTill Kamppeter <tkamppeter@mandriva.com>2003-01-20 02:48:22 +0000
commit830b8a584925f3152c7efac2009a69fe83f4c5f0 (patch)
tree517dfa9b6bd6e46aa9d47961267cff740f991782 /perl-install/detect_devices.pm
parent3957374e1ded186023a817a82458f06d15150192 (diff)
downloaddrakx-830b8a584925f3152c7efac2009a69fe83f4c5f0.tar
drakx-830b8a584925f3152c7efac2009a69fe83f4c5f0.tar.gz
drakx-830b8a584925f3152c7efac2009a69fe83f4c5f0.tar.bz2
drakx-830b8a584925f3152c7efac2009a69fe83f4c5f0.tar.xz
drakx-830b8a584925f3152c7efac2009a69fe83f4c5f0.zip
Improve association of printers with database entries (preparation for
non-interactive print queue generation): - Make use of device ID strings in the Foomatic database - Association of generic printers when PDL (PCL, PCL-XL, PostScript) could be auto-detected - Cleaned up entries from manufacturer-supplied PPDs for PostScript printers to try to match model names of Foomatic entries - Bug fixes on previous association mechanism
Diffstat (limited to 'perl-install/detect_devices.pm')
-rw-r--r--perl-install/detect_devices.pm15
1 files changed, 11 insertions, 4 deletions
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index 1aa420d79..fe5f484cd 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -640,8 +640,9 @@ sub whatUsbport() {
# Remove non-printable characters
$idstr =~ tr/[\x00-\x1f]/\./;
# Extract the printer data from the ID string
- my ($manufacturer, $model, $serialnumber, $description) =
- ("", "", "", "");
+ my ($manufacturer, $model, $serialnumber, $description,
+ $commandset, $sku) =
+ ("", "", "", "", "");
if ($idstr =~ /MFG:([^;]+);/ || $idstr =~ /MANUFACTURER:([^;]+);/) {
$manufacturer = $1;
$manufacturer =~ s/Hewlett[-\s_]Packard/HP/;
@@ -653,7 +654,7 @@ sub whatUsbport() {
$model ||= $1;
}
if ($idstr =~ /SKU:([^;]+);/) {
- $model = $1;
+ $sku = $1;
}
if ($idstr =~ /DES:([^;]+);/ || $idstr =~ /DESCRIPTION:([^;]+);/) {
$description = $1;
@@ -663,6 +664,10 @@ sub whatUsbport() {
if ($idstr =~ /SE*R*N:([^;]+);/) {
$serialnumber = $1;
}
+ if ($idstr =~ /CMD:([^;]+);/ ||
+ $idstr =~ /COMMAND\s*SET:([^;]+);/) {
+ $commandset ||= $1;
+ }
# Was there a manufacturer and a model in the string?
if ($manufacturer eq "" || $model eq "") {
next;
@@ -677,7 +682,9 @@ sub whatUsbport() {
MODEL => $model,
MANUFACTURER => $manufacturer,
DESCRIPTION => $description,
- SERIALNUMBER => $serialnumber
+ SERIALNUMBER => $serialnumber,
+ 'COMMAND SET' => $commandset,
+ SKU => $sku
} };
}
@res;