summaryrefslogtreecommitdiffstats
path: root/convert/merge2pcitable.pl
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 /convert/merge2pcitable.pl
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
Diffstat (limited to 'convert/merge2pcitable.pl')
-rwxr-xr-xconvert/merge2pcitable.pl23
1 files changed, 13 insertions, 10 deletions
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) = @_;