[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Debian BTS Cleanup HOWTO



#include <hallo.h>
* David Schmitt [Sun, Apr 09 2006, 03:36:20PM]:
> Hi everyone!
> 
> In the Viennese Debian Group[1] Maximilian Attems (from the linux-2.6 team) 
> held once a small tutorial on kernel bug triage. I tested the techniques then 
> on the kernel bugs and later on kopete's quite unmaintained bugs. Here I 
> present my methods and a few text templates for further reference. 
> 
> I would welcome any feedback about style and content as well as suggestions 
> whether this could/should be posted at some accessible location.
> 
> 
> -----------------------------------------------------------------------
> 
> Debian BTS Cleanup HOWTO

Dunno how much it helps, a while ago (while adopting a bug hole package)
I wrote a script to spa^h^h^h send mails to a group of bugreporters.
The work flow is simple:

 - use the script to fetch the formated list
 - edit with your favorite editor and remote the people you don't want
   to contact yet (keep the d key down in vim ;-)
 - take a mail template, set $TEMPLATE to the file location
 - use the script to massmail to the people in the list file

Script attached, sample template is embedded therein. (Note: the code to
read from an external template file is untested, tell me if it doesn't
work).

Eduard.

-- 
<jjFux> Wirklich schwierig, ein neues fortune unterzubringen. weasel macht nen
	netten Spruch und reagiert nicht auf meinen Vorschlag, Alfie schickt
	mich zu Zomb, Zomb zu weasel.
#!/usr/bin/perl
# Get all bug reports from a special package and notify the reports of
# bugs marked with special flag
#
# TODO
# make it better configurable
# /(\w[^\ ]+\@\w[^\ ]+\.\w+)/
#

$newvers = "1.2.10";
$backport= "deb http://people.debian.org/~blade/backports ./";
$subject = "Bug presence confirmation, Bug __BUGNR__";
$mailcmd = "mutt";

sub help {
die(
'
USAGE: '.$0.' command [arguments]

This script will get the list of bug reports against some package and
notify all bug reporters processing with a message based on email body
template. It can save the list to a local file and reread it later, so
you can modify it as needed.

COMMANDS:

   getlist package (Output: STDOUT, ascii, bugnr/email/title tuple)
   notify listfile (send the messages using mutt)
   simulate list tmpdir (like notify but don\'t send, dump the messages)

'
); 
}

&help if($#ARGV lt 0);

open($f, $ENV{"TEMPLATE"}) or die "Could not open template, please set \$TEMPLATE to a useable file.";
$text=join("", <$f>);

$text_old_example = <<EOF
Hello,

A long time ago in a galaxy not far away (this one),

you filed a bug report against the package __PKG__, with the description:

__DESC__

which has been registred as bug number __BUGNR__ [1] in our bug tracking
system.

In the meantime a new upstream version of the software has been made
available in Debian. Few days ago the new Debian Stable release appeared with
the potentially fixed version of __PKG__.

Please test it and see if the problem you reported still persists. If the
problem is gone, please close your report by sending a short explanation mail
to __BUGNR__-done\@bugs.debian.org .
And please try to react to this message in appropriate time (few weeks).

Please refer to the Release Notes for update instructions. If your apt is
already configured for the Sarge distribution, the following should be enough:

     apt-get update
     apt-get install __PKG__

I am looking forward to seeing your reports.

Thanks,
Eduard.

[1] http://bugs.debian.org/__BUGNR__

EOF
;

if($ARGV[0] eq "getlist") {
   &help if ($#ARGV ne 1);
   open(getcmd, "wget -q -O - http://bugs.debian.org/cgi-bin/pkgreport.cgi?pkg=".$ARGV[1].";  |");
   #open(getcmd, "cat tmplist |");
   print $ARGV[1]."\n";
   while(<getcmd>) {
      if($_ =~ /<li><a href="bugreport.cgi.bug=(\d+)">.\d+: (.+)<.a>/) {
         if($upstream && defined($bugnr)) {
            print "$submitter;;;$bugtitle;;;$bugnr\n";
            undef $upstream;
         }
         $bugnr = $1;
         $bugtitle = $2;
      }
      if($_ =~ /Reported by: .*submitter=(.+)">.+<.a>/) {
         $submitter=$1;
      }
#      if($_ =~ /Tags:.+upstream/) {
         $upstream = 1;
#      }
   }
   exit 0;
}

if($ARGV[0] eq "simulate") {
   &help if($#ARGV ne 2);
   $filemode=1;
}
elsif($ARGV[0] eq "notify") {
   &help if ($#ARGV ne 1);
   $filemode=0;
}
else { &help; }

open(liste, "<".$ARGV[1]);
$pkg = <liste>;
chop $pkg;
while(<liste>) {
   /(.+);;;(.+);;;(.+)/;
   my $body = $text;
   $nr = $3;
   $desc = $2;

   if($filemode) {
      open(output, ">".$ARGV[2]."/$1");
   }
   else {
       my $sbj=$subject;
       $sbj=~/__BUGNR__/$nr/;
      open(output, "| $mailcmd -s \"$sbj\" $1");
   }
   
   $body =~ s/__BUGNR__/$nr/g;
   $body =~ s/__PKG__/$pkg/g;
   $body =~ s/__DESC__/$desc/g;
   $body =~ s/__VERS__/$newvers/g;
   $body =~ s/__BACKPORTAPTLINE__/$backport/g;
   print output $body;
}

Reply to: