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
31 my @message; #holds copy of msg to apply tags
33 #############################################################################
35 #############################################################################
36 # Hash used to process commandline options
40 my %opthash = (# ------------------ actions
41 "config|c=s" => \$config,
43 "version|V" => \&banner,
44 "verbose|v!" => \$verbose,
45 "quiet|q!" => \$quiet,
46 "debug|d+" => \$debug, # Count the -d flags
48 Getopt::Long::config('bundling', 'no_getopt_compat', 'no_auto_abbrev');
49 GetOptions(%opthash) or &syntax( 1 );
51 { print "D2: Commandline:\n";
52 print "\tconfig = $config\n" unless $config eq '';
53 print "\tverbos\n" if $verbose;
54 print "\tquiet\n" if $quiet;
55 print "\tdebug = $debug\n";
57 $Globals{ 'debug' } = $debug;
58 $Globals{ 'quiet' } = $quiet;
59 $Globals{ 'verbose' } = $verbose;
61 #############################################################################
62 # Read Config File and parse
63 #############################################################################
64 $config = "./debbugs.cfg" if( $config eq '' );
65 print "D1: config file=$config\n" if $Globals{ 'debug' };
66 @config = Debbugs::Config::ParseConfigFile( $config );
68 #############################################################################
69 # Load in template emails
70 #############################################################################
71 @notify_done_email = Debbugs::Email::LoadEmail( $Globals{ 'template-dir' }.'/'.$Globals{ 'not-don-con' } );
73 #############################################################################
74 # Find file name and load input file
75 #############################################################################
77 m/^[RC]\.\d+$/ || &fail("bad argument");
80 if (!rename( $Globals{ 'spool-dir' }."G$inputfilename", $Globals{ 'spool-dir' }."P$inputfilename"))
82 m/no such file or directory/i && exit 0;
83 &fail("renaming to lock: $!");
86 ############################################################################
87 # Set up MIME Message class
88 ############################################################################
89 my $parser = new MIME::Parser;
90 $parser->output_dir("$ENV{HOME}/mimemail");
91 $parser->output_prefix("part");
92 $parser->output_to_core(100000);
93 my $inputmail = $parser->parse_in("P$inputfilename") or die "couldn't parse MIME file";
94 #for use when stdin in stead of file is used
95 #my $inputmail = $parser->read(\*STDIN) or die "couldn't parse MIME stream";
97 ############################################################################
98 # Extract first part (if mime type) for processing. All else assumed junk
99 ############################################################################
100 if ( $inputmail->is_multipart )
101 { my $parts = $inputmail->parts( 0 );
102 while( $parts->is_multipart ) { $parts = $parts->parts( 0 ); }
103 @body = $parts->bodyhandle->as_lines;
105 else { @body = $inputmail->bodyhandle->as_lines; }
108 $inputmail->head->count('From') || &fail( "no From header" );
110 ############################################################################
111 # Determine Reply To address
112 ############################################################################
113 $replyto= $inputmail->head->count( "Reply-to" ) ? $inputmail->head->get( "Reply-to" ) : $inputmail->head->get( "From" );
115 ############################################################################
116 # Start processing of commands
117 ############################################################################
119 if ( $control ) { &transcript("Processing commands for control message:\n\n"); }
120 else { &transcript("Processing commands for request message:\n\n"); }
122 ####################################### HERE ###############################
125 $mergelowstate= 'idle';
129 for ( my $procline=0; $procline<=$#body; $procline++)
132 $state eq 'idle' || print "$state ?\n";
133 $lowstate eq 'idle' || print "$lowstate ?\n";
134 $mergelowstate eq 'idle' || print "$mergelowstate ?\n";
138 s/\s+$//; #strip ending white space, including newlines
141 next unless m/\S/; #skip blank lines
142 next if m/^\s*\#/; #skip comment-only lines
143 &transcript("> $_\n");
147 if (m/^stop\s/i || m/^quit\s/i || m/^--/ || m/^thank\s/i)
148 { &transcript("Stopping processing here.\n\n");
150 } elsif (m/^debug\s+(\d+)$/i && $1 >= 0 && $1 <= 1000)
152 &transcript("Debug level $debug.\n\n");
153 } elsif (m/^(send|get)\s+\#?(\d{2,})$/i)
154 { $ref= $2+0; $reffile= $ref; $reffile =~ s,^..,$&/$&,;
155 &sendlynxdoc( "db/$reffile.html", "logs for $gBug#$ref" );
156 } elsif (m/^send-detail\s+\#?(\d+)$/i)
157 { $ref= $1+0; $reffile= $ref; $reffile =~ s,^..,$&/$&,;
158 &sendlynxdoc("db/$reffile-b.html","additional logs for $gBug#$ref");
159 } elsif (m/^index(\s+full)?$/i) {
160 &sendlynxdoc("db/ix/full.html",'full index');
161 } elsif (m/^index-summary\s+by-package$/i) {
162 &sendlynxdoc("db/ix/psummary.html",'summary index sorted by package/title');
163 } elsif (m/^index-summary(\s+by-number)?$/i) {
164 &sendlynxdoc("db/ix/summary.html",'summary index sorted by number/date');
165 } elsif (m/^index(\s+|-)pack(age)?s?$/i) {
166 &sendlynxdoc("db/ix/packages.html",'index of packages');
167 } elsif (m/^index(\s+|-)maints?$/i) {
168 &sendlynxdoc("db/ix/maintainers.html",'index of maintainers');
169 } elsif (m/^index(\s+|-)maint\s+(\S.*\S)$/i) {
170 $substrg= $2; $matches=0;
171 opendir(DBD,"$gWebDir/db/ma") || die $!;
172 while (defined($_=readdir(DBD))) {
173 next unless m/^l/ && m/\.html$/;
174 &transcript("F|$_\n") if $dl>1;
175 $filename= $_; s/^l//; s/\.html$//;
176 &transcript("P|$_\n") if $dl>2;
177 while (s/-(..)([^_])/-$1_-$2/) { }
178 &transcript("P|$_\n") if $dl>2;
179 s/^(.{0,2})_/$1-20_/g; while (s/([^-]..)_/$1-20_/) { };
180 &transcript("P|$_\n") if $dl>2;
181 s/^,(.*),(.*),([^,]+)$/$1-40_$2-20_-28_$3-29_/;
182 &transcript("P|$_\n") if $dl>2;
183 s/^([^,]+),(.*),(.*),$/$1-20_-3c_$2-40_$3-3e_/;
184 &transcript("P|$_\n") if $dl>2;
186 &transcript("P|$_\n") if $dl>2;
188 while (m/-(..)_/) { $out.= $`.sprintf("%c",hex($1)); $_=$'; }
190 &transcript("M|$out\n") if $dl>1;
191 next unless index(lc $out, lc $substrg)>=0;
192 &transcript("S|$filename\n") if $dl>0;
193 &transcript("S|$out\n") if $dl>0;
195 &sendlynxdocraw("db/ma/$filename","$gBug list for maintainer \`$out'");
198 &transcript("$gBug list(s) for $matches maintainer(s) sent.\n\n");
200 &transcript("No maintainers found containing \`$substrg'.\n".
201 "Use \`index-maint' to get list of maintainers.\n\n");
204 } elsif (m/^index(\s+|-)pack(age)?s?\s+(\S.*\S)$/i) {
205 $substrg= $+; $matches=0;
206 opendir(DBD,"$gWebDir/db/pa") || die $!;
207 while (defined($_=readdir(DBD))) {
208 next unless m/^l/ && m/\.html$/;
209 &transcript("F|$_\n") if $dl>1;
210 $filename= $_; s/^l//; s/\.html$//;
211 next unless index(lc $_, lc $substrg)>=0;
212 &transcript("S|$filename\n") if $dl>0;
213 &transcript("S|$out\n") if $dl>0;
215 &sendlynxdocraw("db/pa/$filename","$gBug list for package \`$_'");
218 &transcript("$gBug list(s) for $matches package(s) sent.\n\n");
220 &transcript("No packages found containing \`$substrg'.\n".
221 "Use \`index-packages' to get list of packages.\n\n");
224 } elsif (m/^send-unmatched(\s+this|\s+-?0)?$/i) {
225 &sendlynxdoc("db/ju/unmatched-1.html","junk (this week)");
226 } elsif (m/^send-unmatched\s+(last|-1)$/i) {
227 &sendlynxdoc("db/ju/unmatched-2.html","junk (last week)");
228 } elsif (m/^send-unmatched\s+(old|-2)$/i) {
229 &sendlynxdoc("db/ju/unmatched-3.html","junk (two weeks ago)");
230 } elsif (m/^getinfo\s+(\S+)$/i) {
232 if ($file =~ m/^\./ || $file !~ m/^[-.0-9a-z]+$/ || $file =~ m/\.gz$/) {
233 &transcript("Filename $file is badly formatted.\n\n");
234 } elsif (open(P,"$gDocDir/$file")) {
236 &transcript("Info file $file appears below.\n\n");
237 $extras.= "\n---------- Info file $file follows:\n\n";
238 while(<P>) { $extras.= $_; }
241 &transcript("Info file $file does not exist.\n\n");
243 } elsif (m/^help$/i) {
247 } elsif (m/^refcard$/i) {
248 &sendtxthelp("bug-mailserver-refcard.txt","mailservers' reference card");
249 } elsif (m/^subscribe/i) {
251 There is no $gProject $gBug mailing list. If you wish to review bug reports
252 please do so via http://$gWebUrl/ or ask this mailserver
254 soon: MAILINGLISTS_TEXT
256 } elsif (m/^unsubscribe/i) {
258 soon: UNSUBSCRIBE_TEXT
259 soon: MAILINGLISTS_TEXT
261 } elsif (!$control) {
263 Unknown command or malformed arguments to command.
264 (Use control\@$gEmailDomain to manipulate reports.)
267 if (++$unknowns >= 3) {
268 &transcript("Too many unknown commands, stopping here.\n\n");
271 } elsif (m/^close\s+\#?(\d+)$/i) {
275 if (length($s_done)) {
276 &transcript("$gBug is already closed, cannot re-close.\n\n");
279 $action= "$gBug closed, ack sent to submitter - they'd better know why !";
281 &addmaintainers($s_package);
282 if ( length( $gDoneList ) > 0 && length( $gListDomain ) > 0 )
283 { &addccaddress("$gDoneList\@$gListDomain"); }
285 @message = @notify_done_email;
286 &Debbugs::Email::ProcessTags( ... );
287 &sendmailmessage( join( "\n", @message), $s_originator );
288 } while (&getnextbug);
291 } elsif (m/^reassign\s+\#?(\d+)\s+(\S.*\S)$/i) {
293 $ref= $1; $newpackage= $2;
294 $newpackage =~ y/A-Z/a-z/;
296 if (length($s_package)) {
297 $action= "$gBug reassigned from package \`$s_package'".
298 " to \`$newpackage'.";
300 $action= "$gBug assigned to package \`$newpackage'.";
303 &addmaintainers($s_package);
304 &addmaintainers($newpackage);
305 $s_package= $newpackage;
306 } while (&getnextbug);
308 } elsif (m/^reopen\s+\#?(\d+)$/i ? ($noriginator='', 1) :
309 m/^reopen\s+\#?(\d+)\s+\=$/i ? ($noriginator='', 1) :
310 m/^reopen\s+\#?(\d+)\s+\!$/i ? ($noriginator=$replyto, 1) :
311 m/^reopen\s+\#?(\d+)\s+(\S.*\S)$/i ? ($noriginator=$2, 1) : 0) {
315 if (!length($s_done)) {
316 &transcript("$gByg is already open, cannot reopen.\n\n");
320 $noriginator eq '' ? "$gBug reopened, originator not changed." :
321 "$gBug reopened, originator set to $noriginator.";
323 &addmaintainers($s_package);
324 $s_originator= $noriginator eq '' ? $s_originator : $noriginator;
326 } while (&getnextbug);
329 } elsif (m/^forwarded\s+\#?(\d+)\s+(\S.*\S)$/i) {
331 $ref= $1; $whereto= $2;
333 if (length($s_forwarded)) {
334 $action= "Forwarded-to-address changed from $s_forwarded to $whereto.";
336 $action= "Noted your statement that $gBug has been forwarded to $whereto.";
338 if (length($s_done)) {
339 $extramessage= "(By the way, this $gBug is currently marked as done.)\n";
342 &addmaintainers($s_package);
343 if (length($gFowardList)>0 && length($gListDomain)>0 )
344 { &addccaddress("$gFowardList\@$gListDomain"); }
345 $s_forwarded= $whereto;
346 } while (&getnextbug);
348 } elsif (m/^notforwarded\s+\#?(\d+)$/i) {
352 if (!length($s_forwarded)) {
353 &transcript("$gBug is not marked as having been forwarded.\n\n");
356 $action= "Removed annotation that $gBug had been forwarded to $s_forwarded.";
358 &addmaintainers($s_package);
360 } while (&getnextbug);
363 } elsif (m/^severity\s+\#?(\d+)\s+([-0-9a-z]+)$/i ||
364 m/^priority\s+\#?(\d+)\s+([-0-9a-z]+)$/i) {
368 if (!grep($_ eq $newseverity, @severities, "$gDefaultSeverity")) {
369 &transcript("Severity level \`$newseverity' is not known.\n".
370 "Recognised are: ".join(' ',@showseverities).".\n\n");
372 $printseverity= $s_severity;
373 $printseverity= "$gDefaultSeverity" if $printseverity eq '';
374 $action= "Severity set to \`$newseverity'.";
376 &addmaintainers($s_package);
377 $s_severity= $newseverity;
378 } while (&getnextbug);
380 } elsif (m/^retitle\s+\#?(\d+)\s+(\S.*\S)\s*$/i) {
382 $ref= $1; $newtitle= $2;
385 &addmaintainers($s_package);
386 $s_subject= $newtitle;
387 $action= "Changed $gBug title.";
389 &transcript("$action\n");
390 if (length($s_done)) {
391 &transcript("(By the way, that $gBug is currently marked as done.)\n");
397 } elsif (m/^unmerge\s+\#?(\d+)$/i) {
401 if (!length($s_mergedwith)) {
402 &transcript("$gBug is not marked as being merged with any others.\n\n");
405 $mergelowstate eq 'locked' || die "$mergelowstate ?";
406 $action= "Disconnected #$ref from all other report(s).";
407 @newmergelist= split(/ /,$s_mergedwith);
410 &addmaintainers($s_package);
411 $s_mergedwith= ($ref == $discref) ? ''
412 : join(' ',grep($_ ne $ref,@newmergelist));
413 } while (&getnextbug);
416 } elsif (m/^merge\s+(\d+(\s+\d+)+)\s*$/i) {
418 @tomerge= sort { $a <=> $b } split(/\s+/,$1);
421 while (defined($ref= shift(@tomerge))) {
422 &transcript("D| checking merge $ref\n") if $dl;
424 next if grep($_ eq $ref,@newmergelist);
425 if (!&getbug) { ¬foundbug; @newmergelist=(); last }
427 &transcript("D| adding $ref ($s_mergewith)\n") if $dl;
429 &checkmatch('package','m_package',$s_package);
430 &checkmatch('forwarded addr','m_forwarded',$s_forwarded);
431 &checkmatch('severity','m_severity',$s_severity);
432 &checkmatch('done mark','m_done',length($s_done) ? 'done' : 'open');
433 if (length($mismatch)) {
434 &transcript("Mismatch - only $Bugs in same state can be merged:\n".
436 &cancelbug; @newmergelist=(); last;
438 push(@newmergelist,$ref);
439 push(@tomerge,split(/ /,$s_mergedwith));
443 @newmergelist= sort { $a <=> $b } @newmergelist;
444 $action= "Merged @newmergelist.";
445 for $ref (@newmergelist) {
446 &getbug || die "huh ? $gBug $ref disappeared during merge";
447 &addmaintainers($s_package);
448 $s_mergedwith= join(' ',grep($_ ne $ref,@newmergelist));
451 &transcript("$action\n\n");
455 &transcript("Unknown command or malformed arguments to command.\n\n");
456 if (++$unknowns >= 5) {
457 &transcript("Too many unknown commands, stopping here.\n\n");
462 if ($procline>$#msg) {
463 &transcript(">\nEnd of message, stopping processing here.\n\n");
466 &transcript("No commands successfully parsed; sending the help text(s).\n");
471 &transcript("MC\n") if $dl>1;
473 for $maint (keys %maintccreasons) {
474 &transcript("MM|$maint|\n") if $dl>1;
475 next if $maint eq $replyto;
477 $reasonsref= $maintccreasons{$maint};
478 &transcript("MY|$maint|\n") if $dl>2;
479 for $p (sort keys %$reasonsref) {
480 &transcript("MP|$p|\n") if $dl>2;
481 $reasonstring.= ', ' if length($reasonstring);
482 $reasonstring.= $p.' ' if length($p);
483 $reasonstring.= join(' ',map("#$_",sort keys %{$$reasonsref{$p}}));
485 push(@maintccs,"$maint ($reasonstring)");
486 push(@maintccaddrs,"$maint");
489 &transcript("MC|@maintccs|\n") if $dl>2;
490 $maintccs= "Cc: ".join(",\n ",@maintccs)."\n";
491 } else { $maintccs = ""; }
494 From: $gMaintainerEmail ($gProject $gBug Tracking System)
496 ${maintccs}Subject: Processed: $header{'subject'}
497 In-Reply-To: $header{'message-id'}
498 References: $header{'message-id'}
499 Message-ID: <handler.s.$nn.transcript\@$gEmailDomain>
501 ${transcript}Please contact me if you need assistance.
504 (administrator, $gProject $gBugs database)
508 $repliedshow= join(', ',$replyto,@maintccaddrs);
509 &filelock("lock/-1");
510 open(AP,">>db/-1.log") || &quit("open db/-1.log: $!");
512 "\2\n$repliedshow\n\5\n$reply\n\3\n".
514 "<strong>Request received</strong> from <code>".
515 &sani($header{'from'})."</code>\n".
516 "to <code>".&sani($controlrequestaddr)."</code>\n".
518 "\7\n",@log,"\n\3\n") || &quit("writing db/-1.log: $!");
519 close(AP) || &quit("open db/-1.log: $!");
521 utime(time,time,"db");
523 &sendmailmessage($reply,$replyto,@maintccaddrs);
525 unlink("incoming/P$nn") || &quit("unlinking incoming/P$nn: $!");
529 map { $_->address() }
530 map { Mail::Address->parse($_) } @_;
533 sub sendmailmessage {
534 local ($message,@recips) = @_;
535 print "mailing to >@recips<\n" if $debug;
537 defined($c) || &quit("mailing forking for sendmail: $!");
538 if (!$c) { # ie, we are the child process
539 exec '/usr/lib/sendmail','-f'."$gMaintainerEmail",'-odi','-oem','-oi',get_addresses(@recips);
542 print(D $message) || &quit("writing to sendmail process: $!");
543 $!=0; close(D); $? && &quit("sendmail gave exit status $? ($!)");
548 &sendtxthelpraw("bug-log-mailserver.txt","instructions for request\@$gEmailDomain");
549 &sendtxthelpraw("bug-maint-mailcontrol.txt","instructions for control\@$gEmailDomain")
554 # &transcript("Sorry, command $_[0] not yet implemented.\n\n");
558 local ($string,$mvarname,$svarvalue) = @_;
561 eval "\$mvarvalue= \$$mvarname";
562 &transcript("D| checkmatch \`$string' /$mvarname/$mvarvalue/$svarvalue/\n")
565 "Values for \`$string' don't match:\n".
566 " #$newmergelist[0] has \`$mvarvalue';\n".
567 " #$ref has \`$svarvalue'\n"
568 if $mvarvalue ne $svarvalue;
570 &transcript("D| setupmatch \`$string' /$mvarname/$svarvalue/\n")
572 eval "\$$mvarname= \$svarvalue";
576 # High-level bug manipulation calls
577 # Do announcements themselves
579 # Possible calling sequences:
583 # &transcript(something)
587 # $action= (something)
589 # (modify s_* variables)
590 # } while (getnextbug);
593 &dlen("nochangebug");
594 $state eq 'single' || $state eq 'multiple' || die "$state ?";
596 &endmerge if $manybugs;
598 &dlex("nochangebug");
602 &dlen("setbug $ref");
603 $state eq 'idle' || die "$state ?";
606 &dlex("setbug => 0s");
609 @thisbugmergelist= split(/ /,$s_mergedwith);
610 if (!@thisbugmergelist) {
615 &dlex("setbug => 1s");
624 &dlex("setbug => 0mc");
628 $state= 'multiple'; $sref=$ref;
629 &dlex("setbug => 1m");
635 $state eq 'single' || $state eq 'multiple' || die "$state ?";
637 if (!$manybugs || !@thisbugmergelist) {
638 length($action) || die;
639 &transcript("$action\n$extramessage\n");
640 &endmerge if $manybugs;
642 &dlex("getnextbug => 0");
645 $ref= shift(@thisbugmergelist);
646 &getbug || die "bug $ref disappeared";
648 &dlex("getnextbug => 1");
652 # Low-level bug-manipulation calls
653 # Do no announcements
661 # $action= (something)
666 # [getbug (returns 0)]
667 # &transcript("$action\n\n")
670 sub notfoundbug { &transcript("$gBug number $ref not found.\n\n"); }
671 sub foundbug { &transcript("$gBug#$ref: $s_subject\n"); }
675 $mergelowstate eq 'idle' || die "$mergelowstate ?";
676 &filelock('lock/merge');
677 $mergelowstate='locked';
683 $mergelowstate eq 'locked' || die "$mergelowstate ?";
685 $mergelowstate='idle';
690 &dlen("getbug $ref");
691 $lowstate eq 'idle' || die "$state ?";
692 if (&lockreadbug($ref)) {
695 &dlex("getbug => 1");
700 &dlex("getbug => 0");
706 $lowstate eq 'open' || die "$state ?";
713 &dlen("savebug $ref");
714 $lowstate eq 'open' || die "$lowstate ?";
715 length($action) || die;
716 $ref == $sref || die "read $sref but saving $ref ?";
717 open(L,">>db/$ref.log") || &quit("opening db/$ref.log: $!");
720 "<strong>".&sani($action)."</strong>\n".
721 "Request was from <code>".&sani($header{'from'})."</code>\n".
722 "to <code>".&sani($controlrequestaddr)."</code>. \n".
724 "\7\n",@log,"\n\3\n") || &quit("writing db/$ref.log: $!");
725 close(L) || &quit("closing db/$ref.log: $!");
726 open(S,">db/$ref.status.new") || &quit("opening db/$ref.status.new: $!");
737 "$s_severity\n") || &quit("writing db/$ref.status.new: $!");
738 close(S) || &quit("closing db/$ref.status.new: $!");
739 rename("db/$ref.status.new","db/$ref.status") ||
740 &quit("installing new db/$ref.status: $!");
748 &transcript("C> @_ ($state $lowstate $mergelowstate)\n");
753 &transcript("R> @_ ($state $lowstate $mergelowstate)\n");
757 print $_[0] if $debug;
774 local ($relpath,$description) = @_;
776 open(D,"$gDocDir/$relpath") || &quit("open doc file $relpath: $!");
777 while(<D>) { $doc.=$_; }
779 &transcript("Sending $description in separate message.\n");
780 &sendmailmessage(<<END.$doc,$replyto);
781 From: $gMaintainerEmail ($gProject $gBug Tracking System)
783 Subject: $gProject $gBug help: $description
784 References: $header{'message-id'}
785 In-Reply-To: $header{'message-id'}
786 Message-ID: <handler.s.$nn.help.$midix\@$gEmailDomain>
793 local ($relpath,$description) = @_;
795 open(L,"lynx -nolist -dump $wwwbase/$relpath 2>&1 |") || &quit("fork for lynx: $!");
796 while(<L>) { $doc.=$_; }
798 if ($? == 255 && $doc =~ m/^\n*lynx: Can\'t access start file/) {
799 &transcript("Information ($description) is not available -\n".
800 "perhaps the $gBug does not exist or is not on the WWW yet.\n");
803 &transcript("Error getting $description (code $? $!):\n$doc\n");
805 &transcript("Sending $description.\n");
806 &sendmailmessage(<<END.$doc,$replyto);
807 From: $gMaintainerEmail ($gProject $gBug Tracking System)
809 Subject: $gProject $gBugs information: $description
810 References: $header{'message-id'}
811 In-Reply-To: $header{'message-id'}
812 Message-ID: <handler.s.$nn.info.$midix\@$gEmailDomain>
821 $maintccreasons{$cca}{''}{$ref}= 1;
825 { # Data structure is:
826 # maintainer email address &c -> assoc of packages -> assoc of bug#'s
827 my ($p, $addmaint, $pshow);
828 &ensuremaintainersloaded;
829 $anymaintfound=0; $anymaintnotfound=0;
830 for $p (split(m/[ \t?,()]+/,$_[0]))
832 $pshow= ($p =~ m/[-+.a-z0-9]+/ ? $& : '');
833 if (defined($maintainerof{$p}))
834 { $addmaint= $maintainerof{$p};
835 &transcript("MR|$addmaint|$p|$ref|\n") if $dl>2;
836 $maintccreasons{$addmaint}{$p}{$ref}= 1;
837 print "maintainer add >$p|$addmaint<\n" if $debug;
838 } else { print "maintainer none >$p<\n" if $debug; }
842 sub ensuremaintainersloaded {
844 return if $maintainersloaded++;
845 open(MAINT,"$gMaintainerFile") || die &quit("maintainers open: $!");
847 m/^(\S+)\s+(\S.*\S)\n$/ || &quit("maintainers bogus \`$_'");
848 $a= $1; $b= $2; $a =~ y/A-Z/a-z/;
849 $maintainerof{$1}= $2;
856 print <<"EOT-EOT-EOT";
857 Syntax: $FILE [options]
858 -c, --config CFGFILE read CFGFILE for configuration (default=./debvote.cfg)
859 -h, --help display this help text
860 -v, --verbose verbose messages
861 -q, --quiet cancels verbose in a config file
862 -V, --version display Debvote version and exit
863 -d, --debug turn debug messages ON (multiple -d for more verbose)