2 # Usage: service <code>.nn
3 # Temps: incoming/P<code>.nn
14 #############################################################################
15 # Gloabal Variable Declaration
16 #############################################################################
17 my $VERSION = '3.01'; #External Version number
18 my $BANNER = "DebBugs v$VERSION"; #Version Banner - text form
19 my $FILE = 'debbugs-service'; #File name
23 my $inputfilename; #file specified on commandline
26 my $control; #call to control or request
28 my @body; #list of commands
29 my $replyto; #address of to send reply to
30 my $transcript; #building of return message
32 #############################################################################
34 #############################################################################
35 # Hash used to process commandline options
39 my %opthash = (# ------------------ actions
40 "config|c=s" => \$config,
42 "version|V" => \&banner,
43 "verbose|v!" => \$verbose,
44 "quiet|q!" => \$quiet,
45 "debug|d+" => \$debug, # Count the -d flags
47 Getopt::Long::config('bundling', 'no_getopt_compat', 'no_auto_abbrev');
48 GetOptions(%opthash) or &syntax( 1 );
50 { print "D2: Commandline:\n";
51 print "\tconfig = $config\n" unless $config eq '';
52 print "\tverbos\n" if $verbose;
53 print "\tquiet\n" if $quiet;
54 print "\tdebug = $debug\n";
56 $Globals{ 'debug' } = $debug;
57 $Globals{ 'quiet' } = $quiet;
58 $Globals{ 'verbose' } = $verbose;
60 #############################################################################
61 # Read Config File and parse
62 #############################################################################
63 $config = "./debbugs.cfg" if( $config eq '' );
64 print "D1: config file=$config\n" if $Globals{ 'debug' };
65 @config = Debbugs::Config::ParseConfigFile( $config );
67 #############################################################################
68 # Find file name and load input file
69 #############################################################################
71 m/^[RC]\.\d+$/ || &fail("bad argument");
74 if (!rename( $Globals{ 'spool-dir' }."G$inputfilename", $Globals{ 'spool-dir' }."P$inputfilename"))
76 m/no such file or directory/i && exit 0;
77 &fail("renaming to lock: $!");
80 ############################################################################
81 # Set up MIME Message class
82 ############################################################################
83 my $parser = new MIME::Parser;
84 $parser->output_dir("$ENV{HOME}/mimemail");
85 $parser->output_prefix("part");
86 $parser->output_to_core(100000);
87 my $inputmail = $parser->parse_in("P$inputfilename") or die "couldn't parse MIME file";
88 #for use when stdin in stead of file is used
89 #my $inputmail = $parser->read(\*STDIN) or die "couldn't parse MIME stream";
91 ############################################################################
92 # Extract first part (if mime type) for processing. All else assumed junk
93 ############################################################################
94 if ( $inputmail->is_multipart )
95 { my $parts = $inputmail->parts( 0 );
96 while( $parts->is_multipart ) { $parts = $parts->parts( 0 ); }
97 @body = $parts->bodyhandle->as_lines;
99 else { @body = $inputmail->bodyhandle->as_lines; }
102 $inputmail->head->count('From') || &fail( "no From header" );
104 ############################################################################
105 # Determine Reply To address
106 ############################################################################
107 $replyto= $inputmail->head->count( "Reply-to" ) ? $inputmail->head->get( "Reply-to" ) : $inputmail->head->get( "From" );
109 ############################################################################
110 # Start processing of commands
111 ############################################################################
113 if ( $control ) { &transcript("Processing commands for control message:\n\n"); }
114 else { &transcript("Processing commands for request message:\n\n"); }
116 ####################################### HERE ###############################
119 $mergelowstate= 'idle';
123 for ( my $procline=0; $procline<=$#body; $procline++)
126 $state eq 'idle' || print "$state ?\n";
127 $lowstate eq 'idle' || print "$lowstate ?\n";
128 $mergelowstate eq 'idle' || print "$mergelowstate ?\n";
132 s/\s+$//; #strip ending white space, including newlines
135 next unless m/\S/; #skip blank lines
136 next if m/^\s*\#/; #skip comment-only lines
137 &transcript("> $_\n");
141 if (m/^stop\s/i || m/^quit\s/i || m/^--/ || m/^thank\s/i)
142 { &transcript("Stopping processing here.\n\n");
144 } elsif (m/^debug\s+(\d+)$/i && $1 >= 0 && $1 <= 1000)
146 &transcript("Debug level $debug.\n\n");
147 } elsif (m/^(send|get)\s+\#?(\d{2,})$/i)
148 { $ref= $2+0; $reffile= $ref; $reffile =~ s,^..,$&/$&,;
149 &sendlynxdoc( "db/$reffile.html", "logs for $gBug#$ref" );
150 } elsif (m/^send-detail\s+\#?(\d+)$/i) {
151 $ref= $1+0; $reffile= $ref; $reffile =~ s,^..,$&/$&,;
152 &sendlynxdoc("db/$reffile-b.html","additional logs for $gBug#$ref");
153 } elsif (m/^index(\s+full)?$/i) {
154 &sendlynxdoc("db/ix/full.html",'full index');
155 } elsif (m/^index-summary\s+by-package$/i) {
156 &sendlynxdoc("db/ix/psummary.html",'summary index sorted by package/title');
157 } elsif (m/^index-summary(\s+by-number)?$/i) {
158 &sendlynxdoc("db/ix/summary.html",'summary index sorted by number/date');
159 } elsif (m/^index(\s+|-)pack(age)?s?$/i) {
160 &sendlynxdoc("db/ix/packages.html",'index of packages');
161 } elsif (m/^index(\s+|-)maints?$/i) {
162 &sendlynxdoc("db/ix/maintainers.html",'index of maintainers');
163 } elsif (m/^index(\s+|-)maint\s+(\S.*\S)$/i) {
164 $substrg= $2; $matches=0;
165 opendir(DBD,"$gWebDir/db/ma") || die $!;
166 while (defined($_=readdir(DBD))) {
167 next unless m/^l/ && m/\.html$/;
168 &transcript("F|$_\n") if $dl>1;
169 $filename= $_; s/^l//; s/\.html$//;
170 &transcript("P|$_\n") if $dl>2;
171 while (s/-(..)([^_])/-$1_-$2/) { }
172 &transcript("P|$_\n") if $dl>2;
173 s/^(.{0,2})_/$1-20_/g; while (s/([^-]..)_/$1-20_/) { };
174 &transcript("P|$_\n") if $dl>2;
175 s/^,(.*),(.*),([^,]+)$/$1-40_$2-20_-28_$3-29_/;
176 &transcript("P|$_\n") if $dl>2;
177 s/^([^,]+),(.*),(.*),$/$1-20_-3c_$2-40_$3-3e_/;
178 &transcript("P|$_\n") if $dl>2;
180 &transcript("P|$_\n") if $dl>2;
182 while (m/-(..)_/) { $out.= $`.sprintf("%c",hex($1)); $_=$'; }
184 &transcript("M|$out\n") if $dl>1;
185 next unless index(lc $out, lc $substrg)>=0;
186 &transcript("S|$filename\n") if $dl>0;
187 &transcript("S|$out\n") if $dl>0;
189 &sendlynxdocraw("db/ma/$filename","$gBug list for maintainer \`$out'");
192 &transcript("$gBug list(s) for $matches maintainer(s) sent.\n\n");
194 &transcript("No maintainers found containing \`$substrg'.\n".
195 "Use \`index-maint' to get list of maintainers.\n\n");
198 } elsif (m/^index(\s+|-)pack(age)?s?\s+(\S.*\S)$/i) {
199 $substrg= $+; $matches=0;
200 opendir(DBD,"$gWebDir/db/pa") || die $!;
201 while (defined($_=readdir(DBD))) {
202 next unless m/^l/ && m/\.html$/;
203 &transcript("F|$_\n") if $dl>1;
204 $filename= $_; s/^l//; s/\.html$//;
205 next unless index(lc $_, lc $substrg)>=0;
206 &transcript("S|$filename\n") if $dl>0;
207 &transcript("S|$out\n") if $dl>0;
209 &sendlynxdocraw("db/pa/$filename","$gBug list for package \`$_'");
212 &transcript("$gBug list(s) for $matches package(s) sent.\n\n");
214 &transcript("No packages found containing \`$substrg'.\n".
215 "Use \`index-packages' to get list of packages.\n\n");
218 } elsif (m/^send-unmatched(\s+this|\s+-?0)?$/i) {
219 &sendlynxdoc("db/ju/unmatched-1.html","junk (this week)");
220 } elsif (m/^send-unmatched\s+(last|-1)$/i) {
221 &sendlynxdoc("db/ju/unmatched-2.html","junk (last week)");
222 } elsif (m/^send-unmatched\s+(old|-2)$/i) {
223 &sendlynxdoc("db/ju/unmatched-3.html","junk (two weeks ago)");
224 } elsif (m/^getinfo\s+(\S+)$/i) {
226 if ($file =~ m/^\./ || $file !~ m/^[-.0-9a-z]+$/ || $file =~ m/\.gz$/) {
227 &transcript("Filename $file is badly formatted.\n\n");
228 } elsif (open(P,"$gDocDir/$file")) {
230 &transcript("Info file $file appears below.\n\n");
231 $extras.= "\n---------- Info file $file follows:\n\n";
232 while(<P>) { $extras.= $_; }
235 &transcript("Info file $file does not exist.\n\n");
237 } elsif (m/^help$/i) {
241 } elsif (m/^refcard$/i) {
242 &sendtxthelp("bug-mailserver-refcard.txt","mailservers' reference card");
243 } elsif (m/^subscribe/i) {
245 There is no $gProject $gBug mailing list. If you wish to review bug reports
246 please do so via http://$gWebUrl/ or ask this mailserver
248 soon: MAILINGLISTS_TEXT
250 } elsif (m/^unsubscribe/i) {
252 soon: UNSUBSCRIBE_TEXT
253 soon: MAILINGLISTS_TEXT
255 } elsif (!$control) {
257 Unknown command or malformed arguments to command.
258 (Use control\@$gEmailDomain to manipulate reports.)
261 if (++$unknowns >= 3) {
262 &transcript("Too many unknown commands, stopping here.\n\n");
265 } elsif (m/^close\s+\#?(\d+)$/i) {
269 if (length($s_done)) {
270 &transcript("$gBug is already closed, cannot re-close.\n\n");
273 $action= "$gBug closed, ack sent to submitter - they'd better know why !";
275 &addmaintainers($s_package);
276 if ( length( $gDoneList ) > 0 && length( $gListDomain ) >
277 0 ) { &addccaddress("$gDoneList\@$gListDomain"); }
280 From: $gMaintainerEmail ($gProject $gBug Tracking System)
282 Subject: $gBug#$ref acknowledged by developer
284 References: $header{'message-id'} $s_msgid
285 In-Reply-To: $s_msgid
286 Message-ID: <handler.$ref.$nn.notifdonectrl.$midix\@$gEmailDomain>
288 This is an automatic notification regarding your $gBug report.
290 It has been marked as closed by one of the developers, namely
293 You should be hearing from them with a substantive response shortly,
294 if you have not already done so. If not, please contact them
298 (administrator, $gProject $gBugs database)
300 &sendmailmessage($message,$s_originator);
301 } while (&getnextbug);
304 } elsif (m/^reassign\s+\#?(\d+)\s+(\S.*\S)$/i) {
306 $ref= $1; $newpackage= $2;
307 $newpackage =~ y/A-Z/a-z/;
309 if (length($s_package)) {
310 $action= "$gBug reassigned from package \`$s_package'".
311 " to \`$newpackage'.";
313 $action= "$gBug assigned to package \`$newpackage'.";
316 &addmaintainers($s_package);
317 &addmaintainers($newpackage);
318 $s_package= $newpackage;
319 } while (&getnextbug);
321 } elsif (m/^reopen\s+\#?(\d+)$/i ? ($noriginator='', 1) :
322 m/^reopen\s+\#?(\d+)\s+\=$/i ? ($noriginator='', 1) :
323 m/^reopen\s+\#?(\d+)\s+\!$/i ? ($noriginator=$replyto, 1) :
324 m/^reopen\s+\#?(\d+)\s+(\S.*\S)$/i ? ($noriginator=$2, 1) : 0) {
328 if (!length($s_done)) {
329 &transcript("$gByg is already open, cannot reopen.\n\n");
333 $noriginator eq '' ? "$gBug reopened, originator not changed." :
334 "$gBug reopened, originator set to $noriginator.";
336 &addmaintainers($s_package);
337 $s_originator= $noriginator eq '' ? $s_originator : $noriginator;
339 } while (&getnextbug);
342 } elsif (m/^forwarded\s+\#?(\d+)\s+(\S.*\S)$/i) {
344 $ref= $1; $whereto= $2;
346 if (length($s_forwarded)) {
347 $action= "Forwarded-to-address changed from $s_forwarded to $whereto.";
349 $action= "Noted your statement that $gBug has been forwarded to $whereto.";
351 if (length($s_done)) {
352 $extramessage= "(By the way, this $gBug is currently marked as done.)\n";
355 &addmaintainers($s_package);
356 if (length($gFowardList)>0 && length($gListDomain)>0 )
357 { &addccaddress("$gFowardList\@$gListDomain"); }
358 $s_forwarded= $whereto;
359 } while (&getnextbug);
361 } elsif (m/^notforwarded\s+\#?(\d+)$/i) {
365 if (!length($s_forwarded)) {
366 &transcript("$gBug is not marked as having been forwarded.\n\n");
369 $action= "Removed annotation that $gBug had been forwarded to $s_forwarded.";
371 &addmaintainers($s_package);
373 } while (&getnextbug);
376 } elsif (m/^severity\s+\#?(\d+)\s+([-0-9a-z]+)$/i ||
377 m/^priority\s+\#?(\d+)\s+([-0-9a-z]+)$/i) {
381 if (!grep($_ eq $newseverity, @severities, "$gDefaultSeverity")) {
382 &transcript("Severity level \`$newseverity' is not known.\n".
383 "Recognised are: ".join(' ',@showseverities).".\n\n");
385 $printseverity= $s_severity;
386 $printseverity= "$gDefaultSeverity" if $printseverity eq '';
387 $action= "Severity set to \`$newseverity'.";
389 &addmaintainers($s_package);
390 $s_severity= $newseverity;
391 } while (&getnextbug);
393 } elsif (m/^retitle\s+\#?(\d+)\s+(\S.*\S)\s*$/i) {
395 $ref= $1; $newtitle= $2;
398 &addmaintainers($s_package);
399 $s_subject= $newtitle;
400 $action= "Changed $gBug title.";
402 &transcript("$action\n");
403 if (length($s_done)) {
404 &transcript("(By the way, that $gBug is currently marked as done.)\n");
410 } elsif (m/^unmerge\s+\#?(\d+)$/i) {
414 if (!length($s_mergedwith)) {
415 &transcript("$gBug is not marked as being merged with any others.\n\n");
418 $mergelowstate eq 'locked' || die "$mergelowstate ?";
419 $action= "Disconnected #$ref from all other report(s).";
420 @newmergelist= split(/ /,$s_mergedwith);
423 &addmaintainers($s_package);
424 $s_mergedwith= ($ref == $discref) ? ''
425 : join(' ',grep($_ ne $ref,@newmergelist));
426 } while (&getnextbug);
429 } elsif (m/^merge\s+(\d+(\s+\d+)+)\s*$/i) {
431 @tomerge= sort { $a <=> $b } split(/\s+/,$1);
434 while (defined($ref= shift(@tomerge))) {
435 &transcript("D| checking merge $ref\n") if $dl;
437 next if grep($_ eq $ref,@newmergelist);
438 if (!&getbug) { ¬foundbug; @newmergelist=(); last }
440 &transcript("D| adding $ref ($s_mergewith)\n") if $dl;
442 &checkmatch('package','m_package',$s_package);
443 &checkmatch('forwarded addr','m_forwarded',$s_forwarded);
444 &checkmatch('severity','m_severity',$s_severity);
445 &checkmatch('done mark','m_done',length($s_done) ? 'done' : 'open');
446 if (length($mismatch)) {
447 &transcript("Mismatch - only $Bugs in same state can be merged:\n".
449 &cancelbug; @newmergelist=(); last;
451 push(@newmergelist,$ref);
452 push(@tomerge,split(/ /,$s_mergedwith));
456 @newmergelist= sort { $a <=> $b } @newmergelist;
457 $action= "Merged @newmergelist.";
458 for $ref (@newmergelist) {
459 &getbug || die "huh ? $gBug $ref disappeared during merge";
460 &addmaintainers($s_package);
461 $s_mergedwith= join(' ',grep($_ ne $ref,@newmergelist));
464 &transcript("$action\n\n");
468 &transcript("Unknown command or malformed arguments to command.\n\n");
469 if (++$unknowns >= 5) {
470 &transcript("Too many unknown commands, stopping here.\n\n");
475 if ($procline>$#msg) {
476 &transcript(">\nEnd of message, stopping processing here.\n\n");
479 &transcript("No commands successfully parsed; sending the help text(s).\n");
484 &transcript("MC\n") if $dl>1;
486 for $maint (keys %maintccreasons) {
487 &transcript("MM|$maint|\n") if $dl>1;
488 next if $maint eq $replyto;
490 $reasonsref= $maintccreasons{$maint};
491 &transcript("MY|$maint|\n") if $dl>2;
492 for $p (sort keys %$reasonsref) {
493 &transcript("MP|$p|\n") if $dl>2;
494 $reasonstring.= ', ' if length($reasonstring);
495 $reasonstring.= $p.' ' if length($p);
496 $reasonstring.= join(' ',map("#$_",sort keys %{$$reasonsref{$p}}));
498 push(@maintccs,"$maint ($reasonstring)");
499 push(@maintccaddrs,"$maint");
502 &transcript("MC|@maintccs|\n") if $dl>2;
503 $maintccs= "Cc: ".join(",\n ",@maintccs)."\n";
504 } else { $maintccs = ""; }
507 From: $gMaintainerEmail ($gProject $gBug Tracking System)
509 ${maintccs}Subject: Processed: $header{'subject'}
510 In-Reply-To: $header{'message-id'}
511 References: $header{'message-id'}
512 Message-ID: <handler.s.$nn.transcript\@$gEmailDomain>
514 ${transcript}Please contact me if you need assistance.
517 (administrator, $gProject $gBugs database)
521 $repliedshow= join(', ',$replyto,@maintccaddrs);
522 &filelock("lock/-1");
523 open(AP,">>db/-1.log") || &quit("open db/-1.log: $!");
525 "\2\n$repliedshow\n\5\n$reply\n\3\n".
527 "<strong>Request received</strong> from <code>".
528 &sani($header{'from'})."</code>\n".
529 "to <code>".&sani($controlrequestaddr)."</code>\n".
531 "\7\n",@log,"\n\3\n") || &quit("writing db/-1.log: $!");
532 close(AP) || &quit("open db/-1.log: $!");
534 utime(time,time,"db");
536 &sendmailmessage($reply,$replyto,@maintccaddrs);
538 unlink("incoming/P$nn") || &quit("unlinking incoming/P$nn: $!");
542 map { $_->address() }
543 map { Mail::Address->parse($_) } @_;
546 sub sendmailmessage {
547 local ($message,@recips) = @_;
548 print "mailing to >@recips<\n" if $debug;
550 defined($c) || &quit("mailing forking for sendmail: $!");
551 if (!$c) { # ie, we are the child process
552 exec '/usr/lib/sendmail','-f'."$gMaintainerEmail",'-odi','-oem','-oi',get_addresses(@recips);
555 print(D $message) || &quit("writing to sendmail process: $!");
556 $!=0; close(D); $? && &quit("sendmail gave exit status $? ($!)");
561 &sendtxthelpraw("bug-log-mailserver.txt","instructions for request\@$gEmailDomain");
562 &sendtxthelpraw("bug-maint-mailcontrol.txt","instructions for control\@$gEmailDomain")
567 # &transcript("Sorry, command $_[0] not yet implemented.\n\n");
571 local ($string,$mvarname,$svarvalue) = @_;
574 eval "\$mvarvalue= \$$mvarname";
575 &transcript("D| checkmatch \`$string' /$mvarname/$mvarvalue/$svarvalue/\n")
578 "Values for \`$string' don't match:\n".
579 " #$newmergelist[0] has \`$mvarvalue';\n".
580 " #$ref has \`$svarvalue'\n"
581 if $mvarvalue ne $svarvalue;
583 &transcript("D| setupmatch \`$string' /$mvarname/$svarvalue/\n")
585 eval "\$$mvarname= \$svarvalue";
589 # High-level bug manipulation calls
590 # Do announcements themselves
592 # Possible calling sequences:
596 # &transcript(something)
600 # $action= (something)
602 # (modify s_* variables)
603 # } while (getnextbug);
606 &dlen("nochangebug");
607 $state eq 'single' || $state eq 'multiple' || die "$state ?";
609 &endmerge if $manybugs;
611 &dlex("nochangebug");
615 &dlen("setbug $ref");
616 $state eq 'idle' || die "$state ?";
619 &dlex("setbug => 0s");
622 @thisbugmergelist= split(/ /,$s_mergedwith);
623 if (!@thisbugmergelist) {
628 &dlex("setbug => 1s");
637 &dlex("setbug => 0mc");
641 $state= 'multiple'; $sref=$ref;
642 &dlex("setbug => 1m");
648 $state eq 'single' || $state eq 'multiple' || die "$state ?";
650 if (!$manybugs || !@thisbugmergelist) {
651 length($action) || die;
652 &transcript("$action\n$extramessage\n");
653 &endmerge if $manybugs;
655 &dlex("getnextbug => 0");
658 $ref= shift(@thisbugmergelist);
659 &getbug || die "bug $ref disappeared";
661 &dlex("getnextbug => 1");
665 # Low-level bug-manipulation calls
666 # Do no announcements
674 # $action= (something)
679 # [getbug (returns 0)]
680 # &transcript("$action\n\n")
683 sub notfoundbug { &transcript("$gBug number $ref not found.\n\n"); }
684 sub foundbug { &transcript("$gBug#$ref: $s_subject\n"); }
688 $mergelowstate eq 'idle' || die "$mergelowstate ?";
689 &filelock('lock/merge');
690 $mergelowstate='locked';
696 $mergelowstate eq 'locked' || die "$mergelowstate ?";
698 $mergelowstate='idle';
703 &dlen("getbug $ref");
704 $lowstate eq 'idle' || die "$state ?";
705 if (&lockreadbug($ref)) {
708 &dlex("getbug => 1");
713 &dlex("getbug => 0");
719 $lowstate eq 'open' || die "$state ?";
726 &dlen("savebug $ref");
727 $lowstate eq 'open' || die "$lowstate ?";
728 length($action) || die;
729 $ref == $sref || die "read $sref but saving $ref ?";
730 open(L,">>db/$ref.log") || &quit("opening db/$ref.log: $!");
733 "<strong>".&sani($action)."</strong>\n".
734 "Request was from <code>".&sani($header{'from'})."</code>\n".
735 "to <code>".&sani($controlrequestaddr)."</code>. \n".
737 "\7\n",@log,"\n\3\n") || &quit("writing db/$ref.log: $!");
738 close(L) || &quit("closing db/$ref.log: $!");
739 open(S,">db/$ref.status.new") || &quit("opening db/$ref.status.new: $!");
750 "$s_severity\n") || &quit("writing db/$ref.status.new: $!");
751 close(S) || &quit("closing db/$ref.status.new: $!");
752 rename("db/$ref.status.new","db/$ref.status") ||
753 &quit("installing new db/$ref.status: $!");
761 &transcript("C> @_ ($state $lowstate $mergelowstate)\n");
766 &transcript("R> @_ ($state $lowstate $mergelowstate)\n");
770 print $_[0] if $debug;
787 local ($relpath,$description) = @_;
789 open(D,"$gDocDir/$relpath") || &quit("open doc file $relpath: $!");
790 while(<D>) { $doc.=$_; }
792 &transcript("Sending $description in separate message.\n");
793 &sendmailmessage(<<END.$doc,$replyto);
794 From: $gMaintainerEmail ($gProject $gBug Tracking System)
796 Subject: $gProject $gBug help: $description
797 References: $header{'message-id'}
798 In-Reply-To: $header{'message-id'}
799 Message-ID: <handler.s.$nn.help.$midix\@$gEmailDomain>
806 local ($relpath,$description) = @_;
808 open(L,"lynx -nolist -dump $wwwbase/$relpath 2>&1 |") || &quit("fork for lynx: $!");
809 while(<L>) { $doc.=$_; }
811 if ($? == 255 && $doc =~ m/^\n*lynx: Can\'t access start file/) {
812 &transcript("Information ($description) is not available -\n".
813 "perhaps the $gBug does not exist or is not on the WWW yet.\n");
816 &transcript("Error getting $description (code $? $!):\n$doc\n");
818 &transcript("Sending $description.\n");
819 &sendmailmessage(<<END.$doc,$replyto);
820 From: $gMaintainerEmail ($gProject $gBug Tracking System)
822 Subject: $gProject $gBugs information: $description
823 References: $header{'message-id'}
824 In-Reply-To: $header{'message-id'}
825 Message-ID: <handler.s.$nn.info.$midix\@$gEmailDomain>
834 $maintccreasons{$cca}{''}{$ref}= 1;
838 { # Data structure is:
839 # maintainer email address &c -> assoc of packages -> assoc of bug#'s
840 my ($p, $addmaint, $pshow);
841 &ensuremaintainersloaded;
842 $anymaintfound=0; $anymaintnotfound=0;
843 for $p (split(m/[ \t?,()]+/,$_[0]))
845 $pshow= ($p =~ m/[-+.a-z0-9]+/ ? $& : '');
846 if (defined($maintainerof{$p}))
847 { $addmaint= $maintainerof{$p};
848 &transcript("MR|$addmaint|$p|$ref|\n") if $dl>2;
849 $maintccreasons{$addmaint}{$p}{$ref}= 1;
850 print "maintainer add >$p|$addmaint<\n" if $debug;
851 } else { print "maintainer none >$p<\n" if $debug; }
855 sub ensuremaintainersloaded {
857 return if $maintainersloaded++;
858 open(MAINT,"$gMaintainerFile") || die &quit("maintainers open: $!");
860 m/^(\S+)\s+(\S.*\S)\n$/ || &quit("maintainers bogus \`$_'");
861 $a= $1; $b= $2; $a =~ y/A-Z/a-z/;
862 $maintainerof{$1}= $2;
869 print <<"EOT-EOT-EOT";
870 Syntax: $FILE [options]
871 -c, --config CFGFILE read CFGFILE for configuration (default=./debvote.cfg)
872 -h, --help display this help text
873 -v, --verbose verbose messages
874 -q, --quiet cancels verbose in a config file
875 -V, --version display Debvote version and exit
876 -d, --debug turn debug messages ON (multiple -d for more verbose)