]> git.decadent.org.uk Git - dak.git/blob - tools/obsolete_lintian_tags.pl
LOCAL: Remove replay check
[dak.git] / tools / obsolete_lintian_tags.pl
1 #!/usr/bin/perl
2 #
3 # Generates a list of obsolete lintian autoreject tags
4 # (C) 2012 Niels Thykier <nthykier@debian.org>
5 # (C) 2012 Luca Falavigna <dktrkranz@debian.org>
6 #
7 # This program is free software; you can redistribute it and/or
8 # modify it under the terms of the GNU General Public License
9 # version 2 as published by the Free Software Foundation.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 # General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 # 02111-1307 USA
20
21
22 use strict;
23 use warnings;
24
25 BEGIN {
26     $ENV{'LINTIAN_ROOT'} = '/usr/share/lintian'
27         unless defined $ENV{'LINTIAN_ROOT'};
28 };
29
30 use Getopt::Long;
31 use lib "$ENV{'LINTIAN_ROOT'}/lib";
32 use Lintian::Profile;
33
34 my $profile = Lintian::Profile->new ('debian');
35 my @lintian_tags = (sort $profile->tags(1));
36 my $autoreject_tags = '../config/debian/lintian.tags';
37
38 open (LINTIAN, $autoreject_tags) or die ('Could not open lintian tags file.');
39 foreach my $tag (<LINTIAN>) {
40     if ($tag =~ m/\s+- \S+/) {
41         $tag =~ s/\s+- //;
42         chomp $tag;
43         print "$tag\n" if not grep (/^$tag$/i, @lintian_tags);
44     }
45 }
46 close (LINTIAN);
47
48 exit 0;