ids-update.pl revision 8db6dcfd3c3d19d35767f04884a99368f6c64b36
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 usb_classes {
my $class;
my $subclass;
my $protocol;
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) {
$class = uc $1;
my $text = $2;
next;
}
print(OUT "\n");
next;
}
if (not defined $class) {
next;
} elsif ($line =~ m/^$/) {
last;
}
if (defined $1) {
$subclass = uc $1;
my $text = $2;
next;
}
print(OUT "\n");
next;
}
if (defined $1) {
$protocol = uc $1;
my $text = $2;
next;
}
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;
} elsif ($line =~ m/^$/) {
last;
}
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();
usb_classes();
pci_vendor();
pci_classes();
oui();