diff options
Diffstat (limited to 'convert')
-rw-r--r-- | convert/Makefile | 5 | ||||
-rwxr-xr-x | convert/merge2pcitable.pl | 23 | ||||
-rwxr-xr-x | convert/verify_Cards.pl | 22 |
3 files changed, 39 insertions, 11 deletions
diff --git a/convert/Makefile b/convert/Makefile index 1aec5909..a98e951b 100644 --- a/convert/Makefile +++ b/convert/Makefile @@ -1,6 +1,9 @@ FILES = xf86PciInfo2pcitable -all: $(FILES) +all: $(FILES) verif + +verif: + ./verify_Cards.pl clean: rm -f $(FILES) diff --git a/convert/merge2pcitable.pl b/convert/merge2pcitable.pl index 5aebad80..addd2993 100755 --- a/convert/merge2pcitable.pl +++ b/convert/merge2pcitable.pl @@ -1,19 +1,22 @@ #!/usr/bin/perl -$ARGV[0] eq '-f' and $force = shift; -$ARGV[0] eq '-a' and $all = shift; +if ($0 =~ /merge2pcitable/) +{ + $ARGV[0] eq '-f' and $force = shift; + $ARGV[0] eq '-a' and $all = shift; -my $formats = join '|', grep {$_} map { /^read_(.*)/ ? $1 : '' } keys %main::; + my $formats = join '|', grep {$_} map { /^read_(.*)/ ? $1 : '' } keys %main::; -@ARGV == 3 or die "usage: $0 [-f] [-a] $formats <in_file> <mdk_pcitable>\n"; + @ARGV == 3 or die "usage: $0 [-f] [-a] $formats <in_file> <mdk_pcitable>\n"; -($format, $in, $pcitable) = @ARGV; + ($format, $in, $pcitable) = @ARGV; -my $read = $main::{"read_$format"} or die "unknown format $format (must be one of $formats)\n"; -my $d_pci = read_pcitable($pcitable); -my $d_in = $read->($in); -merge($d_pci, $d_in); -write_pcitable($d_pci); + my $read = $main::{"read_$format"} or die "unknown format $format (must be one of $formats)\n"; + my $d_pci = read_pcitable($pcitable); + my $d_in = $read->($in); + merge($d_pci, $d_in); + write_pcitable($d_pci); +} else { 1 } sub to_string { my ($id, $driver) = @_; diff --git a/convert/verify_Cards.pl b/convert/verify_Cards.pl new file mode 100755 index 00000000..b181704d --- /dev/null +++ b/convert/verify_Cards.pl @@ -0,0 +1,22 @@ +#!/usr/bin/perl + +use lib qw(/usr/lib/libDrakX); +use Xconfigurator; +require './merge2pcitable.pl'; + +$cards = Xconfigurator::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->{$_}) { + print STDERR "unknown card: $_\n"; + $bad++; + } +} + +exit $bad; |