summaryrefslogtreecommitdiffstats
path: root/update-ldetect-lst
blob: 8b351fc8fd41bfd00251e3a82070e117d3b8467e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/perl

my $dir = '/usr/share/ldetect-lst';
my @files = qw(pcitable usbtable isatable pcmciatable);

unlink "$dir/$_" foreach @files;

$ARGV[0] eq '--clean' and exit 0;

foreach (@files) {
    my $d = "$dir/$_.d";
    -d $d or next;
    my @l = sort glob("$d/*.lst") or next;
    open(my $OUT, " > $dir/$_");
    foreach (@l) {
	open(my $IN, $_) or next;
	print $OUT $_ foreach <$IN>;
    }
}