From f51c2854c763b3d5509d0f36d48225131948a865 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 20 Feb 2004 15:55:54 +0000 Subject: display file & line number in the error message (nice for "unknown card", but not that nice for "no Driver for card xxx", but it will do!) --- convert/verify_Cards.pl | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/convert/verify_Cards.pl b/convert/verify_Cards.pl index 61d786f3..a504c332 100755 --- a/convert/verify_Cards.pl +++ b/convert/verify_Cards.pl @@ -6,19 +6,18 @@ require './merge2pcitable.pl'; $cards = Xconfig::card::readCardsDB("../lst/Cards+"); -@cards = map { - my $drivers = read_pcitable("../lst/$_"); - map { /^Card:(.*)/ } grep { /^Card/ } map { $_->[0] } values %$drivers; -} qw(pcitable usbtable); - -foreach (@cards) { - $nb++; - if (!$cards->{$_}) { - warn "unknown card: $_\n"; - $bad++; - } elsif (!$cards->{$_}{Driver}) { - warn "no Driver: $_\n"; - $bad++; +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++; + } } } -- cgit v1.2.1