diff options
Diffstat (limited to 'perl-install/detect_devices.pm')
-rw-r--r-- | perl-install/detect_devices.pm | 7 |
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; |