summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2000-12-18 13:08:29 +0000
committerPascal Rigaux <pixel@mandriva.com>2000-12-18 13:08:29 +0000
commit68ef254ec0d874d2284a33f990be51baddb92488 (patch)
treeea2e7dd29a5eec351ef7d38a96014c821c55acdc
parent6b5d37090668c9337c3e95135e3ff80441349313 (diff)
downloadldetect-lst-68ef254ec0d874d2284a33f990be51baddb92488.tar
ldetect-lst-68ef254ec0d874d2284a33f990be51baddb92488.tar.gz
ldetect-lst-68ef254ec0d874d2284a33f990be51baddb92488.tar.bz2
ldetect-lst-68ef254ec0d874d2284a33f990be51baddb92488.tar.xz
ldetect-lst-68ef254ec0d874d2284a33f990be51baddb92488.zip
add verif
-rw-r--r--.cvsignore1
-rw-r--r--Makefile28
-rw-r--r--Makefile.config4
-rw-r--r--convert/Makefile5
-rwxr-xr-xconvert/merge2pcitable.pl23
-rwxr-xr-xconvert/verify_Cards.pl22
-rw-r--r--lst/.cvsignore1
-rw-r--r--lst/Makefile28
8 files changed, 78 insertions, 34 deletions
diff --git a/.cvsignore b/.cvsignore
index 745c8546..e69de29b 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -1 +0,0 @@
-CardsNames
diff --git a/Makefile b/Makefile
index 67a37338..8a736045 100644
--- a/Makefile
+++ b/Makefile
@@ -1,31 +1,15 @@
-project = ldetect-lst
-prefix = /usr
-datadir = $(prefix)/share
-dir = $(datadir)/$(project)
+include Makefile.config
-build: CardsNames
+build:
+ make -C lst build
clean:
- rm -f *~ CardsNames
-
-CardsNames: Cards+ Cards2CardsNames.pl
- ./Cards2CardsNames.pl $< > $@
+ rm -f *~
+ make -C lst clean
install: build
install -d $(dir)
- for i in pcitable usbtable; do \
- (echo "# !! The original version is available in CVS at" ; \
- echo "# export CVSROOT=:pserver:anoncvs@cvs.mandrakesoft.com:/home/cvs/cooker" ; \
- echo "# cvs login (password \`\`cvs'')" ; \
- echo "# cvs checkout soft/$(project)" ; \
- echo "# or" ; \
- echo "# export CVSROOT=:ext:LOGIN@cvs.mandrakesoft.com:/home/cvs/cooker" ; \
- echo "# export CVS_RSH=ssh" ; \
- echo "# cvs checkout soft/$(project)" ; \
- cat $$i \
- ) > $(dir)/$$i; done
-
- install -m 644 Cards+ CardsNames MonitorsDB isdn.db $(dir)
+ make -C lst install
rpm: clean $(RPM)
(echo "# !! DON'T MODIFY HERE, MODIFY IN THE CVS !!" ; \
diff --git a/Makefile.config b/Makefile.config
new file mode 100644
index 00000000..a7bb7c7c
--- /dev/null
+++ b/Makefile.config
@@ -0,0 +1,4 @@
+project = ldetect-lst
+prefix = /usr
+datadir = $(prefix)/share
+dir = $(datadir)/$(project)
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;
diff --git a/lst/.cvsignore b/lst/.cvsignore
new file mode 100644
index 00000000..745c8546
--- /dev/null
+++ b/lst/.cvsignore
@@ -0,0 +1 @@
+CardsNames
diff --git a/lst/Makefile b/lst/Makefile
new file mode 100644
index 00000000..3287f310
--- /dev/null
+++ b/lst/Makefile
@@ -0,0 +1,28 @@
+include ../Makefile.config
+
+
+build: CardsNames
+
+clean:
+ rm -f *~ CardsNames
+
+CardsNames: Cards+ ../convert/Cards2CardsNames.pl
+ rm -f $@
+ ../convert/Cards2CardsNames.pl $< > $@
+ chmod a-w $@
+
+
+install:
+ for i in pcitable usbtable; do \
+ (echo "# !! The original version is available in CVS at" ; \
+ echo "# export CVSROOT=:pserver:anoncvs@cvs.mandrakesoft.com:/home/cvs/cooker" ; \
+ echo "# cvs login (password \`\`cvs'')" ; \
+ echo "# cvs checkout soft/$(project)" ; \
+ echo "# or" ; \
+ echo "# export CVSROOT=:ext:LOGIN@cvs.mandrakesoft.com:/home/cvs/cooker" ; \
+ echo "# export CVS_RSH=ssh" ; \
+ echo "# cvs checkout soft/$(project)" ; \
+ cat $$i \
+ ) > $(dir)/$$i; done
+
+ install -m 644 Cards+ CardsNames MonitorsDB isdn.db $(dir)