[SCM] Debian package checker branch, master, updated. 2.5.1-160-gf5b9b28
The following commit has been merged in the master branch:
commit 4d0cb3290182b94b66919c6daeda17dfae5ae355
Author: Niels Thykier <niels@thykier.net>
Date: Fri Jul 29 14:07:39 2011 +0200
Revert "Made two tests resistant to umask variance on clone system"
This reverts commit e3d3313ae4ed2c5e84031d74e5ce8aa2f47f2303.
Accidentially included irrelevant (and broken) changes in the
commit.
diff --git a/lib/Lintian/Tags.pm b/lib/Lintian/Tags.pm
index 5f669eb..9dcf59f 100644
--- a/lib/Lintian/Tags.pm
+++ b/lib/Lintian/Tags.pm
@@ -24,7 +24,6 @@ use warnings;
use Lintian::Output;
use Lintian::Tag::Info;
-use Lintian::Tag::Override;
use Util qw(fail);
use base 'Exporter';
@@ -194,20 +193,36 @@ called first or if an attempt is made to issue an unknown tag.
sub _check_overrides {
my ($self, $tag, $extra) = @_;
my $overrides = $self->{info}{$self->{current}}{overrides}{$tag};
- my $stats = $self->{info}{$self->{current}}{'overrides-stats'}{$tag};
return unless $overrides;
if (exists $overrides->{''}) {
- $stats->{''}++;
+ $overrides->{''}++;
return $tag;
} elsif ($extra ne '' and exists $overrides->{$extra}) {
- $stats->{$extra}++;
+ $overrides->{$extra}++;
return "$tag $extra";
} elsif ($extra ne '') {
for (sort keys %$overrides) {
- my $override = $overrides->{$_};
- if ($override->is_pattern && $override->overrides($extra)){
- $stats->{$_}++;
- return $tag . ' ' . $override->extra;
+ my $pattern = $_;
+ my $end = '';
+ my $pat = '';
+ next unless $pattern =~ m/\Q*\E/o;
+ # Split does not help us if $text ends with *
+ # so we deal with that now
+ if ($pattern =~ s/\Q*\E+\z//o){
+ $end = '.*';
+ }
+ # Are there any * left (after the above)?
+ if ($pattern =~ m/\Q*\E/o) {
+ # this works even if $text starts with a *, since
+ # that is split as '', <text>
+ my @pargs = split(m/\Q*\E++/o, $pattern);
+ $pat = join('.*', map { quotemeta($_) } @pargs);
+ } else {
+ $pat = $pattern;
+ }
+ if ($extra =~ m/^$pat$end\z/) {
+ $overrides->{$_}++;
+ return "$tag $_";
}
}
}
@@ -220,7 +235,7 @@ sub _record_stats {
my ($self, $tag, $info, $overridden) = @_;
my $stats = $self->{statistics}{$self->{current}};
if ($overridden) {
- $stats = $self->{statistics}{$self->{current}}{'overrides-stats'};
+ $stats = $self->{statistics}{$self->{current}}{overrides};
}
$stats->{tags}{$tag}++;
$stats->{severity}{$info->severity}++;
@@ -486,13 +501,12 @@ sub file_start {
die "duplicate of file $file added to Lintian::Tags object";
}
$self->{info}{$file} = {
- file => $file,
- package => $pkg,
- version => $version,
- arch => $arch,
- type => $type,
- overrides => {},
- 'overrides-stats' => {},
+ file => $file,
+ package => $pkg,
+ version => $version,
+ arch => $arch,
+ type => $type,
+ overrides => {},
};
$self->{statistics}{$file} = {
types => {},
@@ -548,7 +562,6 @@ sub file_overrides {
# Valid - so far at least
my ($archlist, $tagdata) = ($1, $2);
my ($tag, $extra) = split(m/ /o, $tagdata, 2);
- my $tagover;
if ($archlist) {
# parse and figure
my (@archs) = split(m/\s++/o, $archlist);
@@ -571,9 +584,7 @@ sub file_overrides {
}
next if $ignored->{$tag};
$extra = '' unless defined $extra;
- $tagover = Lintian::Tag::Override->new($tag, { 'extra' => $extra } );
- $info->{'overrides-stats'}{$tag}{$extra} = 0;
- $info->{overrides}{$tag}{$extra} = $tagover;
+ $info->{overrides}{$tag}{$extra} = 0;
} else {
tag('malformed-override', $_);
}
@@ -623,7 +634,7 @@ tag some-tag, regardless of what extra data was associated with it.
sub overrides {
my ($self, $file) = @_;
if ($self->{info}{$file}) {
- return $self->{info}{$file}{'overrides-stats'};
+ return $self->{info}{$file}{overrides};
} else {
return;
}
diff --git a/t/debs/control-files-weird-files/Makefile b/t/debs/control-files-weird-files/Makefile
index c10ee59..29445d8 100644
--- a/t/debs/control-files-weird-files/Makefile
+++ b/t/debs/control-files-weird-files/Makefile
@@ -9,12 +9,11 @@ all:
chown 0:0 control
chmod 644 control
md5sum usr/share/doc/$(name)/* > md5sums
- touch triggers
tar -czf control.tar.gz control md5sums \
special-file isinstallable triggers
ar rc $(name).deb \
debian-binary control.tar.gz data.tar.gz
clean:
- rm -f *.tar.gz *.tar.lzma *.deb md5sums debian-binary triggers
+ rm -f *.tar.gz *.tar.lzma *.deb md5sums debian-binary
rm -rf usr
diff --git a/reporting/lintian-dummy.cfg b/t/debs/control-files-weird-files/triggers
similarity index 100%
copy from reporting/lintian-dummy.cfg
copy to t/debs/control-files-weird-files/triggers
diff --git a/t/tests/files-bad-perm-owner/debian/debian/rules b/t/tests/files-bad-perm-owner/debian/debian/rules
index b352395..78aa93a 100644
--- a/t/tests/files-bad-perm-owner/debian/debian/rules
+++ b/t/tests/files-bad-perm-owner/debian/debian/rules
@@ -14,18 +14,15 @@ override_dh_auto_build:
pod2man --section 1 script > script.1
override_dh_fixperms:
- dh_fixperms
# game
chown 'root:games' debian/$(GPKG)/usr/games/script
# binary
- chown "daemon:daemon" debian/$(PKG)/usr/share/doc/$(PKG)/README
- chmod 0444 debian/$(PKG)/usr/share/doc/$(PKG)/read-only
- chmod 4755 debian/$(PKG)/usr/bin/script-uid
- chmod 2755 debian/$(PKG)/usr/bin/script-gid
- chmod 6755 debian/$(PKG)/usr/bin/script-ugid
- chmod 0775 debian/$(PKG)/usr/bin/script-wexec
- chmod 4744 debian/$(PKG)/usr/bin/script-wuid
- chmod 0751 debian/$(PKG)/usr/bin/script-ro
- chmod 0744 debian/$(PKG)/usr/share/doc/$(PKG)
- chmod 0755 debian/$(PKG)/etc/cron.d/script
- chmod 0755 debian/$(PKG)/etc/emacs.d/script
+ find debian/$(PKG)/ -name 'README' -exec chown "daemon:daemon" {} \;
+ find debian/$(PKG)/ -name 'read-only' -exec chmod a=r {} \;
+ chmod +x,u+s debian/$(PKG)/usr/bin/script-uid
+ chmod +x,g+s debian/$(PKG)/usr/bin/script-gid
+ chmod +x,ug+s debian/$(PKG)/usr/bin/script-ugid
+ chmod +x,g+w debian/$(PKG)/usr/bin/script-wexec
+ chmod u+x,u+s debian/$(PKG)/usr/bin/script-wuid
+ chmod +x,o-r debian/$(PKG)/usr/bin/script-ro
+ chmod go-x debian/$(PKG)/usr/share/doc/$(PKG)
--
Debian package checker
Reply to: