]> err.no Git - dak/commitdiff
Add obsolete_lintian_tags.pl tool to recognize obsolete tags
authorLuca Falavigna <dktrkranz@debian.org>
Wed, 5 Sep 2012 22:03:02 +0000 (22:03 +0000)
committerLuca Falavigna <dktrkranz@debian.org>
Wed, 5 Sep 2012 22:03:02 +0000 (22:03 +0000)
Signed-off-by: Luca Falavigna <dktrkranz@debian.org>
tools/obsolete_lintian_tags.pl [new file with mode: 0755]

diff --git a/tools/obsolete_lintian_tags.pl b/tools/obsolete_lintian_tags.pl
new file mode 100755 (executable)
index 0000000..0de77d3
--- /dev/null
@@ -0,0 +1,49 @@
+#!/usr/bin/perl
+#
+# Generates a list of obsolete lintian autoreject tags
+# (C) 2012 Niels Thykier <nthykier@debian.org>
+# (C) 2012 Luca Falavigna <dktrkranz@debian.org>
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License
+# version 2 as published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+# 02111-1307 USA
+
+
+use strict;
+use warnings;
+
+BEGIN {
+    $ENV{'LINTIAN_ROOT'} = '/usr/share/lintian'
+        unless defined $ENV{'LINTIAN_ROOT'};
+};
+
+use Getopt::Long;
+use lib "$ENV{'LINTIAN_ROOT'}/lib";
+use Lintian::Profile;
+
+my $profile = Lintian::Profile->new ('debian', $ENV{'LINTIAN_ROOT'},
+                                     ["$ENV{'LINTIAN_ROOT'}/profiles"]);
+my @lintian_tags = (sort $profile->tags(1));
+my $autoreject_tags = '../config/debian/lintian.tags';
+
+open (LINTIAN, $autoreject_tags) or die ('Could not open lintian tags file.');
+foreach my $tag (<LINTIAN>) {
+    if ($tag =~ m/\s+- \S+/) {
+        $tag =~ s/\s+- //;
+        chomp $tag;
+        print "$tag\n" if not grep (/^$tag$/i, @lintian_tags);
+    }
+}
+close (LINTIAN);
+
+exit 0;