diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2000-12-16 12:51:18 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2000-12-16 12:51:18 +0000 |
commit | a6548e1013ec7df2bb70adeecb14d1355afa8e5d (patch) | |
tree | 6c2838c0dbb9178984562fd0465ad394bb3da74a | |
parent | 795cbb9daaaccff2e81422fa266e095767d8e5f8 (diff) | |
download | ldetect-lst-a6548e1013ec7df2bb70adeecb14d1355afa8e5d.tar ldetect-lst-a6548e1013ec7df2bb70adeecb14d1355afa8e5d.tar.gz ldetect-lst-a6548e1013ec7df2bb70adeecb14d1355afa8e5d.tar.bz2 ldetect-lst-a6548e1013ec7df2bb70adeecb14d1355afa8e5d.tar.xz ldetect-lst-a6548e1013ec7df2bb70adeecb14d1355afa8e5d.zip |
replace tabs in description with spaces for pciids import (otherwise ruins the
format)
-rwxr-xr-x | convert/merge2pcitable.pl | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/convert/merge2pcitable.pl b/convert/merge2pcitable.pl index a5d85046..c97077d2 100755 --- a/convert/merge2pcitable.pl +++ b/convert/merge2pcitable.pl @@ -73,20 +73,22 @@ sub read_kernel_pcimap { sub read_pciids { my ($f) = @_; my %drivers; - my ($id1, $id2, $class, $line); + my ($id1, $id2, $class, $line, $text); open F, $f or die "read_pciids: can't open $f\n"; foreach (<F>) { chomp; $line++; next if /^#/ || /^;/ || /^\s*$/; if (/^C\s/) { last; - } elsif (/^\t\t(\S+)\s+(\S+)\s+(.*)/) { + } elsif (my ($subid1, $subid2, $text) = /^\t\t(\S+)\s+(\S+)\s+(.*)/) { + $text =~ s/\t/ /g; $id1 && $id2 or die "$f $line: unexpected device\n"; - $drivers{"$id1$id2$1$2"} = [ "unknown", "$class|$3" ]; + $drivers{"$id1$id2$subid1$subid2"} = [ "unknown", "$class|$text" ]; } elsif (/^\t(\S+)\s+(.*)/) { - $id2 = $1; + ($id2, $text) = ($1, $2); + $text =~ s/\t/ /g; $id1 && $id2 or die "$f $line: unexpected device\n"; - $drivers{"$id1${id2}ffffffff"} = [ "unknown", "$class|$2" ]; + $drivers{"$id1${id2}ffffffff"} = [ "unknown", "$class|$text" ]; } elsif (/^(\S+)\s+(.*)/) { $id1 = $1; $class = $class{$2} || $2; |