]> git.decadent.org.uk Git - dak.git/blob - tools/obsolete_lintian_tags.pl
debianqueued: open ftp connection when trying to upload .dak-commands
[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', $ENV{'LINTIAN_ROOT'},
35                                      ["$ENV{'LINTIAN_ROOT'}/profiles"]);
36 my @lintian_tags = (sort $profile->tags(1));
37 my $autoreject_tags = '../config/debian/lintian.tags';
38
39 open (LINTIAN, $autoreject_tags) or die ('Could not open lintian tags file.');
40 foreach my $tag (<LINTIAN>) {
41     if ($tag =~ m/\s+- \S+/) {
42         $tag =~ s/\s+- //;
43         chomp $tag;
44         print "$tag\n" if not grep (/^$tag$/i, @lintian_tags);
45     }
46 }
47 close (LINTIAN);
48
49 exit 0;