From ebb39cbbec146fa4f431b0a5ced772280ceb6f48 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Wed, 7 Mar 2007 11:47:42 +0000 Subject: [PATCH] Read the newest bug format instead of the old, archaic form. --- scanlib.pm | 93 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 49 insertions(+), 44 deletions(-) diff --git a/scanlib.pm b/scanlib.pm index faee90c..a24785a 100644 --- a/scanlib.pm +++ b/scanlib.pm @@ -167,8 +167,6 @@ sub scanspooldir() { local($dir) = @_; local($f); # While we're currently processing local(@list); # List of files to process - local($s_originator, $s_date, $s_subject, $s_msgid, $s_package, $s_keywords); - local($s_done, $s_forwarded, $s_mergedwith, $s_severity); local($skip); # Flow control local($walk); # index variable local($taginfo); # Tag info @@ -176,70 +174,77 @@ sub scanspooldir() { chdir($dir) or die "chdir $dir: $!\n"; opendir(DIR, $dir) or die "opendir $dir: $!\n"; - @list = grep { s/\.status$// } - grep { m/^\d+\.status$/ } + @list = grep { s/\.summary$// } + grep { m/^\d+\.summary$/ } readdir(DIR); closedir(DIR); for $f (@list) { next if $exclude{$f}; # Check the list of bugs to skip - next if (!open(S,"$f.status")); # Check bugs without a status (?) - - chomp($s_originator = ); - chomp($s_date = ); - chomp($s_subject = ); - chomp($s_msgid = ); - chomp($s_package = ); - chomp($s_tags = ); - chomp($s_done = ); - chomp($s_forwarded = ); - chomp($s_mergedwith = ); - chomp($s_severity = ); - close(S); - - next if length($s_done) and not $premature{$f}; - $premature{$f}++ if length($s_done); - - $s_severity =~ y/A-Z/a-z/; - $s_tags =~ y/A-Z/a-z/; - + + my $bug = readbug("$f.summary"); + next if (!defined($bug)); + $skip=1; for $walk (@priorities) { - $skip=0 if $walk eq $s_severity; + $skip=0 if $walk eq $bug->{'severity'}; } - for $tag (split(' ', $s_tags)) { + my @tags = split(' ', $bug->{'keywords'}); + for $tag (@tags) { for $s (@skiptags) { $skip=1 if $tag eq $s; } } next if $skip==1; + + my $oldstable_tag = grep(/^woody$/, @tags); + my $stable_tag = grep(/^sarge$/, @tags); + my $testing_tag = grep(/^etch$/, @tags); + my $unstable_tag = grep(/^sid$/, @tags); + my $experimental_tag = grep(/^experimental$/, @tags); + + # default according to dondelelcaro 2006-11-11 + if (!$oldstable_tag && !$stable_tag && !$testing_tag && !$unstable_tag && !$experimental_tag) { + $testing_tag = 1; + $unstable_tag = 1; + $experimental_tag = 1; + } + + # only bother to check the versioning status for the distributions indicated by the tags + $status_oldstable = getbugstatus($bug, undef, 'oldstable') if ($oldstable_tag); + $status_stable = getbugstatus($bug, undef, 'stable') if ($stable_tag); + $status_testing = getbugstatus($bug, undef, 'testing') if ($testing_tag); + $status_unstable = getbugstatus($bug, undef, 'unstable') if ($unstable_tag); + $status_experimental = getbugstatus($bug, undef, 'experimental') if ($experimental_tag); $relinfo = ""; - $relinfo .= ($s_tags =~ /\bwoody\b/ ? "O" : ""); - $relinfo .= ($s_tags =~ /\bsarge(|\s.*)%/ ? "S" : ""); - $relinfo .= ($s_tags =~ /\betch(|\s.*)$/ ? "T" : ""); - # etch-ignore matches \betch\b :( - $relinfo .= ($s_tags =~ /\bsid\b/ ? "U" : ""); - $relinfo .= ($s_tags =~ /\bexperimental\b/ ? "E" : ""); + $relinfo .= (($oldstable_tag && $status_oldstable->{'pending'} eq 'pending') ? "O" : ""); + $relinfo .= (($stable_tag && $status_stable->{'pending'} eq 'pending') ? "S" : ""); + $relinfo .= (($testing_tag && $status_testing->{'pending'} eq 'pending') ? "T" : ""); + $relinfo .= (($unstable_tag && $status_unstable->{'pending'} eq 'pending') ? "U" : ""); + $relinfo .= (($experimental_tag && $status_experimental->{'pending'} eq 'pending') ? "E" : ""); + + next if $relinfo eq '' and not $premature{$f}; + $premature{$f}++ if $relinfo eq ''; $taginfo = "["; - $taginfo .= ($s_tags =~ /\bpending\b/ ? "P" : " "); - $taginfo .= ($s_tags =~ /\bpatch\b/ ? "+" : " "); - $taginfo .= ($s_tags =~ /\bhelp\b/ ? "H" : " "); - $taginfo .= ($s_tags =~ /\bmoreinfo\b/ ? "M" : " "); - $taginfo .= ($s_tags =~ /\bunreproducible\b/ ? "R" : " "); - $taginfo .= ($s_tags =~ /\bsecurity\b/ ? "S" : " "); - $taginfo .= ($s_tags =~ /\bupstream\b/ ? "U" : " "); - $taginfo .= ($s_tags =~ /\betch-ignore\b/ ? "I" : " "); + $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 .= "]"; - if ($s_mergedwith) { # Only show the first package if things are merged - my @merged = split(' ', $s_mergedwith); + if (length($bug->{'mergedwith'})) { + my @merged = split(' ', $bug->{'mergedwith'}); next if ($merged[0] < $f); } - for $package (split /[,\s]+/, $s_package) { + for $package (split /[,\s]+/, $bug->{'package'}) { $_= $package; y/A-Z/a-z/; $_= $` if m/[^-+._a-z0-9]/; if (not defined $section{$_}) { if (defined $debbugssection{$_}) { @@ -258,7 +263,7 @@ sub scanspooldir() { $relinfo = " [$relinfo]"; } - $bugs{$f} = "$f $taginfo$relinfo $s_subject"; + $bugs{$f} = "$f $taginfo$relinfo " . $bug->{'subject'}; } } -- 2.39.2