Re: new toy

[email protected] (Robert Spier) Sun, 26 Aug 2001 23:35:02 -0700
Newsgroups perl.bugmongers
Message-ID <[email protected]>

I had written something similar a few months ago - except it was
different.  It's around somewhere - but essentially it accepted a
bugid on the command line and a comment on STDIN.  (It's important to
get those comments in the database.)

-R (thinking about track@bugs)


[email protected] writes:
>This is still only experimental, but I wanted to see if people were
>interested. I'm not sure if it actually closes bugs yet, because
>I'm having problems working the email query interface.
>
>In mutt you can pipe messages into it with |close if you stick the
>script in your path (and you could presumably bind this to a
>key).
>
>Michael
>
>#!/usr/bin/perl -w
>
>use strict;
>use Mail::Mailer;
>use Mail::Internet;
>
>my $action = ($0 eq 'close') ? 'close' : 'propose_close';
>
>my $bugdb_email = '[email protected]';
>
>my $mail = new Mail::Internet(\*STDIN);
>
>my $mail_head = $mail->head;
>
># would be useful to put the bug id in X-Perlbug-ID
># Maybe should patch this in the bugtron
>my $subject = $mail_head->get('Subject');
>chomp $subject;
>my $bugid;
>if ($subject =~ /\[ID (\d{8}\.\d{3})\]/) {
>  $bugid = $1;
>} else {
>  print STDERR "Couldn't find a bug in this message, giving up\n";
>  sleep 1;
>  exit 0;
>}
>
>my $mailer = new Mail::Mailer;
>
>$mailer->open( {
>              To => $bugdb_email, 
>              Subject => "-a close b $bugid",
>}
>);
>
>print $mailer <<ENDIT;
>
>This is an automatically generated message from $0 to close
>the perl bug with bugid [$bugid].
>
>ENDIT
>
>$mailer->close;
>
>print STDERR "Closed bugid [$bugid]\n";
>sleep 1;
>exit 0;

--