[SCM] Debian package checker branch, master, updated. 2.5.1-181-gafff852
The following commit has been merged in the master branch:
commit afff8525b38ffddd90f38d07923b5b102ec516f8
Author: Niels Thykier <niels@thykier.net>
Date: Thu Aug 4 16:29:42 2011 +0200
Moved an invariant out of the loop in changes-file
diff --git a/checks/changes-file b/checks/changes-file
index 450aa52..7151df7 100644
--- a/checks/changes-file
+++ b/checks/changes-file
@@ -26,6 +26,13 @@ use Util;
use Lintian::Tags qw(tag);
use Lintian::Check qw(check_maintainer);
+my $UBUNTU_REGEX;
+{
+ my $ubuntu_dists = Lintian::Data->new ('changelog-file/ubuntu-dists');
+ my $reg_str = join('|', $ubuntu_dists->all);
+ $UBUNTU_REGEX = qr/$reg_str/o;
+}
+
sub run {
my $pkg = shift;
@@ -47,15 +54,13 @@ if (!$info->field('description') && $info->field('architecture') ne 'source') {
# check distribution field
if (defined $info->field('distribution')) {
- my $ubuntu_dists = Lintian::Data->new ('changelog-file/ubuntu-dists');
- my $ubuntu_regex = join('|', $ubuntu_dists->all);
my @distributions = split /\s+/o, $info->field('distribution');
for my $distribution (@distributions) {
if ($distribution eq 'UNRELEASED') {
# ignore
- } elsif ($info->field('version') =~ /ubuntu|$ubuntu_regex/
- or $distribution =~ /$ubuntu_regex/) {
- if ($distribution !~ /^(?:$ubuntu_regex)(?:-(?:proposed|updates|backports|security))?$/ ) {
+ } elsif ($info->field('version') =~ m/ubuntu|$UBUNTU_REGEX/o
+ or $distribution =~ m/$UBUNTU_REGEX/o) {
+ if ($distribution !~ m/^(?:$UBUNTU_REGEX)(?:-(?:proposed|updates|backports|security))?$/o ) {
tag 'bad-ubuntu-distribution-in-changes-file',
$distribution;
}
--
Debian package checker
Reply to: