# which was based on an unknown other script.
#
# Global variables:
-# %premature - list of prematurely closed bugreports
-# %exclude - list of bugreports to exclude from the report
# %maintainer - map from packagename to maintainer
# %section - map from packagename to section in the FTP-site
# %packagelist - map from packagename to bugreports
require bugcfg;
package scanlib;
-our (%premature,%exclude,%maintainer,%section,%packagelist,%debbugssection,%bugs);
+our (%maintainer,%section,%packagelist,%debbugssection,%bugs);
# Read the list of maintainer
closedir(DIR);
for $f (@list) {
- next if $exclude{$f}; # Check the list of bugs to skip
-
my $bug = Debbugs::Status::read_bug(summary => "$f.summary");
next if (!defined($bug));
$disttags{'experimental'} = 1;
}
- my $relinfo = "";
+ my $bi = {};
if (defined($section{$bug->{'package'}}) && $section{$bug->{'package'}} eq 'pseudo') {
# versioning information makes no sense for pseudo packages,
# just use the tags
for my $dist qw(oldstable stable testing unstable experimental) {
- $relinfo .= uc(substr($dist, 0, 1)) if $disttags{$dist};
+ $bi->{$dist} = $disttags{$dist};
}
next if (length($bug->{'done'}));
} else {
+ my $affects_any = 0;
+
# only bother to check the versioning status for the distributions indicated by the tags
for my $dist qw(oldstable stable testing unstable experimental) {
local $SIG{__WARN__} = sub {};
+ $bi->{$dist} = 0;
next if (!$disttags{$dist});
- # This is needed for now
- my $exists = 0;
- for my $pkg (split /[,\s]+/, $bug->{'package'}) {
- my @versions = Debbugs::Packages::getversions($pkg, $dist, undef);
- $exists = 1 if (scalar @versions > 0);
- }
- next if !$exists;
-
my $presence = Debbugs::Status::bug_presence(
bug => $f,
status => $bug,
# indicates that no versioning information is present and it's not closed
# unversioned)
if (!defined($presence) || ($presence ne 'absent' && $presence ne 'fixed')) {
- $relinfo .= uc(substr($dist, 0, 1));
+ $bi->{$dist} = 1;
+ $affects_any = 1;
}
}
- next if $relinfo eq '' and not $premature{$f};
- $premature{$f}++ if $relinfo eq '';
+ next if !$affects_any;
}
- $taginfo = "[";
- $taginfo .= ($bug->{'keywords'} =~ /\bpending\b/ ? "P" : " ");
- $taginfo .= ($bug->{'keywords'} =~ /\bpatch\b/ ? "+" : " ");
- $taginfo .= ($bug->{'keywords'} =~ /\bhelp\b/ ? "H" : " ");
- $taginfo .= ($bug->{'keywords'} =~ /\bmoreinfo\b/ ? "M" : " ");
- $taginfo .= ($bug->{'keywords'} =~ /\bunreproducible\b/ ? "R" : " ");
- $taginfo .= ($bug->{'keywords'} =~ /\bsecurity\b/ ? "S" : " ");
- $taginfo .= ($bug->{'keywords'} =~ /\bupstream\b/ ? "U" : " ");
- $taginfo .= ($bug->{'keywords'} =~ /\betch-ignore\b/ ? "I" : " ");
- $taginfo .= "]";
+ for my $keyword qw(pending patch help moreinfo unreproducible security upstream etch-ignore) {
+ $bi->{$keyword} = ($bug->{'keywords'} =~ /\b$keyword\b/) ? 1 : 0;
+ }
if (length($bug->{'mergedwith'})) {
my @merged = split(' ', $bug->{'mergedwith'});
push @{$packagelist{$_}}, $f;
}
- if ($relinfo eq "") { # or $relinfo eq "U" # confuses e.g. #210306
- $relinfo = "";
- } else {
- $relinfo = " [$relinfo]";
- }
+ my $taginfo = get_taginfo($bi);
+ my $relinfo = get_relinfo($bi);
- $bugs{$f} = "$f $taginfo$relinfo " . $bug->{'subject'};
+ $bugs{$f} = "$f [$taginfo] [$relinfo] " . $bug->{'subject'};
}
}
return 1;
}
+sub check_worry_stable {
+ my ($status) = @_;
+
+ if ($status !~ m/ \[[^]]*S/) {
+ return 0;
+ }
+ return 1;
+}
+
+sub get_taginfo {
+ my $bi = shift;
+
+ my $taginfo = "";
+ $taginfo .= $bi->{'pending'} ? "P" : " ";
+ $taginfo .= $bi->{'patch'} ? "+" : " ";
+ $taginfo .= $bi->{'help'} ? "H" : " ";
+ $taginfo .= $bi->{'moreinfo'} ? "M" : " ";
+ $taginfo .= $bi->{'unreproducible'} ? "R" : " ";
+ $taginfo .= $bi->{'security'} ? "S" : " ";
+ $taginfo .= $bi->{'upstream'} ? "U" : " ";
+ $taginfo .= $bi->{'etch-ignore'} ? "I" : " ";
+
+ return $taginfo;
+}
+
+sub get_relinfo {
+ my $bi = shift;
+
+ my $relinfo = "";
+ for my $dist qw(oldstable stable testing unstable experimental) {
+ $relinfo .= uc(substr($dist, 0, 1)) if $bi->{$dist};
+ }
+
+ return $relinfo;
+}
+
+
1;