summaryrefslogtreecommitdiffstats
path: root/convert/verify_Cards.pl
blob: a504c332af38b0449b7f9f668b4c52527fa99f6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/perl

use lib qw(/usr/lib/libDrakX);
use Xconfig::card;
require './merge2pcitable.pl';

$cards = Xconfig::card::readCardsDB("../lst/Cards+");

foreach my $file (qw(pcitable usbtable)) {
    my $drivers = read_pcitable("../lst/$file");
    foreach (values %$drivers) {
	my ($driver, $name, $line) = @$_;
	my ($card) = $driver =~ /^Card:(.*)/ or next;
	if (!$cards->{$card}) {
	    warn "$file:$line: unknown card $name\n";
	    $bad++;
	} elsif (!$cards->{$card}{Driver}) {
	    warn "$file:$line: no Driver for card $name\n";
	    $bad++;
	}
    }
}

exit $bad;