]> git.donarmstrong.com Git - debbugs.git/blob - scripts/mailsummary.in
[project @ 2000-10-14 21:01:22 by joy]
[debbugs.git] / scripts / mailsummary.in
1 #!/usr/bin/perl
2 # $Id: mailsummary.in,v 1.6 2000/10/14 21:01:22 joy Exp $
3
4 require( '/etc/debbugs/config' );
5
6 $ENV{'PATH'} = '/usr/lib/debbugs:'.$ENV{'PATH'};
7 chdir("$gSpoolDir") || die "chdir spool: $!\n";
8
9 #open(DEBUG,">&4");
10
11 if ($ARGV[0] eq 'undone') {
12     $vdef= "(no outstanding $gBug reports on file, or problem running script)\n";
13     $subject= "Unanswered problem reports by date";
14     $intro=
15 "The following problem reports have not yet been marked as `taken up\' by a
16 message to done\@$gEmailDomain or or `forwarded\' by a
17 message to fowarded\@$gEmailDomain."
18     ;
19 } elsif ($ARGV[0] eq 'bymaint') {
20     $vdef= "(no outstanding $gBug reports on file, or problem running script)\n";
21     $subject= "Unanswered problem reports by maintainer and package";
22     $intro=
23 "The following problem reports have not yet been marked as `taken up\' by a
24 message to done\@$gEmailDomain or or `forwarded\' by a
25 message to forwarded\@$gEmailDomain.
26 The maintainer listed against each package is derived from the Maintainer
27 field of the package found in the development tree; there is an override file
28 that can be amended to get the right results if you have taken over a package
29 and do not expect to issue a new version soon.
30
31 Variant versions of the Maintainer field for the same actual package
32 maintainer will be listed separately.
33
34 Maintainers with few outstanding $gBug appear first, to avoid those with few
35 $gBugs being lost deep in the message.
36 "
37     ;
38 } elsif ($ARGV[0] eq 'veryold') {
39     $vdef= '';
40     $subject= "Overdue problem reports by age";
41     $intro=
42 "The following problem reports are very old but have not yet been marked
43 as `taken up\' by a message to done\@$gEmailDomain as forwarded
44 to a developer by CCing a message to fowarded\@$gEmailDomain.
45 Please help ensure that these $gBugs are dealt with quickly, even if you
46 are not the package maintainer in question.  (NB a full list of outstanding
47 $gBug reports is posted periodically - this is a partial list only!)
48 "
49 } else {
50     die "urgk, wrong argument @ARGV";
51 }
52
53 $v=`/usr/lib/debbugs/summary $ARGV[0]`; $? && die "undone failed $?: $!\n";
54
55 $v= $vdef if $v eq '';
56 exit 0 if $v eq '';
57
58 open(D, '| '.join(' ',('/usr/lib/sendmail','-f'.$gMaintainerEmail)).' -odi -oem -oi -t') ||
59     die "start sendmail: $!";
60
61 print D <<END || die "complete sendmail";
62 From: $gMaintainerEmail ($gProject $gBug Tracking System)
63 To: $gSummaryList\@$gListDomain
64 Subject: $subject
65
66 $intro
67 $v
68 Every Tuesday, the listing by package maintainer is posted.
69 Every Frideay, the listing by age of the report is posted.
70
71 Please see the documentation for more information about how to
72 use the $gBug tracking system.  It is available on the WWW at
73 <A HREF=\"http://$gWebDomain/txt/\">$gWebDomain/txt</A>
74 END
75
76 close(D);
77 $? && die "sendmail failed $?: $!\n";
78
79 print length($v)," bytes of summary posted.\n";