ids-update.pl revision cf7ebcea78223b95b2676b97e1d2aad16caa3c86
use strict;
use warnings;
sub usb_vendor {
my $vendor;
print(OUT "# This file is part of systemd.\n" .
"#\n" .
"# Data imported and updated from: http://www.linux-usb.org/usb.ids\n");
$line =~ s/\s+$//;
if (defined $1) {
$vendor = uc $1;
my $text = $2;
print(OUT "\n");
next;
}
if (defined $1) {
my $product = uc $1;
my $text = $2;
print(OUT "\n");
}
}
close(INP);
close(OUTP);
}
sub pci_vendor {
my $vendor;
my $device;
print(OUT "# This file is part of systemd.\n" .
"#\n" .
"# Data imported and updated from: http://pciids.sourceforge.net/v2.2/pci.ids\n");
$line =~ s/\s+$//;
if (defined $1) {
$vendor = uc $1;
my $text = $2;
print(OUT "\n");
next;
}
if (defined $1) {
$device = uc $1;
my $text = $2;
print(OUT "\n");
next;
}
if (defined $1) {
my $sub_vendor = uc $1;
my $sub_device = uc $2;
my $text = $3;
print(OUT "\n");
print(OUT "pci:v0000" . $vendor . "d0000" . $device . "sv0000" . $sub_vendor . "sd0000" . $sub_device . "*\n");
}
}
close(INP);
close(OUTP);
}
sub pci_classes {
my $class;
my $subclass;
my $interface;
print(OUT "# This file is part of systemd.\n" .
"#\n" .
"# Data imported and updated from: http://pciids.sourceforge.net/v2.2/pci.ids\n");
$line =~ s/\s+$//;
if (defined $1) {
$class = uc $1;
my $text = $2;
print(OUT "\n");
next;
}
if (not defined $class) {
next;
}
if (defined $1) {
$subclass = uc $1;
my $text = $2;
print(OUT "\n");
next;
}
if (defined $1) {
$interface = uc $1;
my $text = $2;
print(OUT "\n");
}
}
close(INP);
close(OUTP);
}
sub oui {
print(OUT "# This file is part of systemd.\n" .
"#\n" .
"# Data imported and updated from: http://standards.ieee.org/develop/regauth/oui/oui.txt\n");
$line =~ s/\s+$//;
if (defined $1) {
my $vendor = uc $1;
my $text = $2;
print(OUT "\n");
}
}
close(INP);
close(OUTP);
}
usb_vendor();
pci_vendor();
pci_classes();
oui();