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-service1'; #File name
23 my $inputfilename; #file specified on commandline
26 my $control; #call to control or request
28 #############################################################################
30 #############################################################################
31 # Hash used to process commandline options
35 my %opthash = (# ------------------ actions
36 "config|c=s" => \$config,
38 "version|V" => \&banner,
39 "verbose|v!" => \$verbose,
40 "quiet|q!" => \$quiet,
41 "debug|d+" => \$debug, # Count the -d flags
43 Getopt::Long::config('bundling', 'no_getopt_compat', 'no_auto_abbrev');
44 GetOptions(%opthash) or &syntax( 1 );
46 { print "D2: Commandline:\n";
47 print "\tconfig = $config\n" unless $config eq '';
48 print "\tverbos\n" if $verbose;
49 print "\tquiet\n" if $quiet;
50 print "\tdebug = $debug\n";
52 $Globals{ 'debug' } = $debug;
53 $Globals{ 'quiet' } = $quiet;
54 $Globals{ 'verbose' } = $verbose;
56 #############################################################################
57 # Read Config File and parse
58 #############################################################################
59 $config = "./debbugs.cfg" if( $config eq '' );
60 print "D1: config file=$config\n" if $Globals{ 'debug' };
61 @config = ParseConfigFile( $config );
63 #############################################################################
64 # Find file name and load input file
65 #############################################################################
67 m/^[RC]\.\d+$/ || &quit("bad argument");
70 if (!rename( $Globals{ 'spool-dir' }."G$inputfilename", $Globals{ 'spool-dir' }."P$inputfilename"))
72 m/no such file or directory/i && exit 0;
73 &fail("renaming to lock: $!");
75 open( M, "P$inputfilename" );
77 @inputlog = @inputfile;
80 ####################################### HERE ###############################
81 grep((s/\n$//,s/\s+$//),@msg); #remove blank lines
83 ## DEBUG ## print "###\n",join("##\n",@msg),"\n###\n" if $debug;
88 for ($i=0; $i<=$#msg; $i++)
90 last unless length($_);
92 while ($msg[$i+1] =~ m/^\s/)
96 print ">$_<\n" if $debug;
98 { $v= $1; $v =~ y/A-Z/a-z/;
99 print ">$v=$_<\n" if $debug;
101 } else { print "!>$_<\n" if $debug; }
104 defined($header{'from'}) || &quit("no From header");
105 $replyto= defined($header{'reply-to'}) ? $header{'reply-to'} : $header{'from'};
107 $controlrequestaddr= $control ? "control\@$gEmailDomain" : "request\@$gEmailDomain";
109 &transcript("Processing commands for $controlrequestaddr:\n\n");
114 $mergelowstate= 'idle';
118 #strip blank line(s) after header
119 while ( $i <= $#msg && !length( $msg[$i] ) ) { $fwd .= "\n"; $i++; }
121 #strip, if exists, mime header
122 if ( $msg[$i] =~ /^This is a multi-part message in MIME format./ )
123 { while ( $i <= $#msg && length( $msg[$i] ) ) { $fwd .= $msg[$i] . "\n"; $i++; }
124 while ( $i <= $#msg && !length( $msg[$i] ) ) { $fwd .= "\n"; $i++; }
126 if ( $msg[$i] =~ /^--/ || $msg[$i] =~ /^\s*$/ )
127 { while ( $i <= $#msg && length( $msg[$i] ) ) { $fwd .= $msg[$i]; $i++; }
128 while ( $i <= $#msg && !length( $msg[$i] ) ) { $fwd .= "\n"; $i++; }
132 for ($procline=$i; $procline<=$#msg; $procline++)
133 { $state eq 'idle' || print "$state ?\n";
134 $lowstate eq 'idle' || print "$lowstate ?\n";
135 $mergelowstate eq 'idle' || print "$mergelowstate ?\n";
136 $_= $msg[$procline]; s/\s+$//;
137 next unless m/\S/; next if m/^\s*\#/;
138 &transcript("> $_\n");
140 if (m/^stop\s/i || m/^quit\s/i || m/^--/ || m/^thank\s/i)
141 { &transcript("Stopping processing here.\n\n");
143 } elsif (m/^debug\s+(\d+)$/i && $1 >= 0 && $1 <= 1000) {
145 &transcript("Debug level $dl.\n\n");
146 } elsif (m/^(send|get)\s+\#?(\d{2,})$/i) {
147 $ref= $2+0; $reffile= $ref; $reffile =~ s,^..,$&/$&,;
148 &sendlynxdoc("db/$reffile.html","logs for $gBug#$ref");
149 } elsif (m/^send-detail\s+\#?(\d+)$/i) {
150 $ref= $1+0; $reffile= $ref; $reffile =~ s,^..,$&/$&,;
151 &sendlynxdoc("db/$reffile-b.html","additional logs for $gBug#$ref");
152 } elsif (m/^index(\s+full)?$/i) {
153 &sendlynxdoc("db/ix/full.html",'full index');
154 } elsif (m/^index-summary\s+by-package$/i) {
155 &sendlynxdoc("db/ix/psummary.html",'summary index sorted by package/title');
156 } elsif (m/^index-summary(\s+by-number)?$/i) {
157 &sendlynxdoc("db/ix/summary.html",'summary index sorted by number/date');
158 } elsif (m/^index(\s+|-)pack(age)?s?$/i) {
159 &sendlynxdoc("db/ix/packages.html",'index of packages');
160 } elsif (m/^index(\s+|-)maints?$/i) {
161 &sendlynxdoc("db/ix/maintainers.html",'index of maintainers');
162 } elsif (m/^index(\s+|-)maint\s+(\S.*\S)$/i) {
163 $substrg= $2; $matches=0;
164 opendir(DBD,"$gWebDir/db/ma") || die $!;
165 while (defined($_=readdir(DBD))) {
166 next unless m/^l/ && m/\.html$/;
167 &transcript("F|$_\n") if $dl>1;
168 $filename= $_; s/^l//; s/\.html$//;
169 &transcript("P|$_\n") if $dl>2;
170 while (s/-(..)([^_])/-$1_-$2/) { }
171 &transcript("P|$_\n") if $dl>2;
172 s/^(.{0,2})_/$1-20_/g; while (s/([^-]..)_/$1-20_/) { };
173 &transcript("P|$_\n") if $dl>2;
174 s/^,(.*),(.*),([^,]+)$/$1-40_$2-20_-28_$3-29_/;
175 &transcript("P|$_\n") if $dl>2;
176 s/^([^,]+),(.*),(.*),$/$1-20_-3c_$2-40_$3-3e_/;
177 &transcript("P|$_\n") if $dl>2;
179 &transcript("P|$_\n") if $dl>2;
181 while (m/-(..)_/) { $out.= $`.sprintf("%c",hex($1)); $_=$'; }
183 &transcript("M|$out\n") if $dl>1;
184 next unless index(lc $out, lc $substrg)>=0;
185 &transcript("S|$filename\n") if $dl>0;
186 &transcript("S|$out\n") if $dl>0;
188 &sendlynxdocraw("db/ma/$filename","$gBug list for maintainer \`$out'");
191 &transcript("$gBug list(s) for $matches maintainer(s) sent.\n\n");
193 &transcript("No maintainers found containing \`$substrg'.\n".
194 "Use \`index-maint' to get list of maintainers.\n\n");
197 } elsif (m/^index(\s+|-)pack(age)?s?\s+(\S.*\S)$/i) {
198 $substrg= $+; $matches=0;
199 opendir(DBD,"$gWebDir/db/pa") || die $!;
200 while (defined($_=readdir(DBD))) {
201 next unless m/^l/ && m/\.html$/;
202 &transcript("F|$_\n") if $dl>1;
203 $filename= $_; s/^l//; s/\.html$//;
204 next unless index(lc $_, lc $substrg)>=0;
205 &transcript("S|$filename\n") if $dl>0;
206 &transcript("S|$out\n") if $dl>0;
208 &sendlynxdocraw("db/pa/$filename","$gBug list for package \`$_'");
211 &transcript("$gBug list(s) for $matches package(s) sent.\n\n");
213 &transcript("No packages found containing \`$substrg'.\n".
214 "Use \`index-packages' to get list of packages.\n\n");
217 } elsif (m/^send-unmatched(\s+this|\s+-?0)?$/i) {
218 &sendlynxdoc("db/ju/unmatched-1.html","junk (this week)");
219 } elsif (m/^send-unmatched\s+(last|-1)$/i) {
220 &sendlynxdoc("db/ju/unmatched-2.html","junk (last week)");
221 } elsif (m/^send-unmatched\s+(old|-2)$/i) {
222 &sendlynxdoc("db/ju/unmatched-3.html","junk (two weeks ago)");
223 } elsif (m/^getinfo\s+(\S+)$/i) {
225 if ($file =~ m/^\./ || $file !~ m/^[-.0-9a-z]+$/ || $file =~ m/\.gz$/) {
226 &transcript("Filename $file is badly formatted.\n\n");
227 } elsif (open(P,"$gDocDir/$file")) {
229 &transcript("Info file $file appears below.\n\n");
230 $extras.= "\n---------- Info file $file follows:\n\n";
231 while(<P>) { $extras.= $_; }
234 &transcript("Info file $file does not exist.\n\n");
236 } elsif (m/^help$/i) {
240 } elsif (m/^refcard$/i) {
241 &sendtxthelp("bug-mailserver-refcard.txt","mailservers' reference card");
242 } elsif (m/^subscribe/i) {
244 There is no $gProject $gBug mailing list. If you wish to review bug reports
245 please do so via http://$gWebUrl/ or ask this mailserver
247 soon: MAILINGLISTS_TEXT
249 } elsif (m/^unsubscribe/i) {
251 soon: UNSUBSCRIBE_TEXT
252 soon: MAILINGLISTS_TEXT
254 } elsif (!$control) {
256 Unknown command or malformed arguments to command.
257 (Use control\@$gEmailDomain to manipulate reports.)
260 if (++$unknowns >= 3) {
261 &transcript("Too many unknown commands, stopping here.\n\n");
264 } elsif (m/^close\s+\#?(\d+)$/i) {
268 if (length($s_done)) {
269 &transcript("$gBug is already closed, cannot re-close.\n\n");
272 $action= "$gBug closed, ack sent to submitter - they'd better know why !";
274 &addmaintainers($s_package);
275 if ( length( $gDoneList ) > 0 && length( $gListDomain ) >
276 0 ) { &addccaddress("$gDoneList\@$gListDomain"); }
279 From: $gMaintainerEmail ($gProject $gBug Tracking System)
281 Subject: $gBug#$ref acknowledged by developer
283 References: $header{'message-id'} $s_msgid
284 In-Reply-To: $s_msgid
285 Message-ID: <handler.$ref.$nn.notifdonectrl.$midix\@$gEmailDomain>
287 This is an automatic notification regarding your $gBug report.
289 It has been marked as closed by one of the developers, namely
292 You should be hearing from them with a substantive response shortly,
293 if you have not already done so. If not, please contact them
297 (administrator, $gProject $gBugs database)
299 &sendmailmessage($message,$s_originator);
300 } while (&getnextbug);
303 } elsif (m/^reassign\s+\#?(\d+)\s+(\S.*\S)$/i) {
305 $ref= $1; $newpackage= $2;
306 $newpackage =~ y/A-Z/a-z/;
308 if (length($s_package)) {
309 $action= "$gBug reassigned from package \`$s_package'".
310 " to \`$newpackage'.";
312 $action= "$gBug assigned to package \`$newpackage'.";
315 &addmaintainers($s_package);
316 &addmaintainers($newpackage);
317 $s_package= $newpackage;
318 } while (&getnextbug);
320 } elsif (m/^reopen\s+\#?(\d+)$/i ? ($noriginator='', 1) :
321 m/^reopen\s+\#?(\d+)\s+\=$/i ? ($noriginator='', 1) :
322 m/^reopen\s+\#?(\d+)\s+\!$/i ? ($noriginator=$replyto, 1) :
323 m/^reopen\s+\#?(\d+)\s+(\S.*\S)$/i ? ($noriginator=$2, 1) : 0) {
327 if (!length($s_done)) {
328 &transcript("$gByg is already open, cannot reopen.\n\n");
332 $noriginator eq '' ? "$gBug reopened, originator not changed." :
333 "$gBug reopened, originator set to $noriginator.";
335 &addmaintainers($s_package);
336 $s_originator= $noriginator eq '' ? $s_originator : $noriginator;
338 } while (&getnextbug);
341 } elsif (m/^forwarded\s+\#?(\d+)\s+(\S.*\S)$/i) {
343 $ref= $1; $whereto= $2;
345 if (length($s_forwarded)) {
346 $action= "Forwarded-to-address changed from $s_forwarded to $whereto.";
348 $action= "Noted your statement that $gBug has been forwarded to $whereto.";
350 if (length($s_done)) {
351 $extramessage= "(By the way, this $gBug is currently marked as done.)\n";
354 &addmaintainers($s_package);
355 if (length($gFowardList)>0 && length($gListDomain)>0 )
356 { &addccaddress("$gFowardList\@$gListDomain"); }
357 $s_forwarded= $whereto;
358 } while (&getnextbug);
360 } elsif (m/^notforwarded\s+\#?(\d+)$/i) {
364 if (!length($s_forwarded)) {
365 &transcript("$gBug is not marked as having been forwarded.\n\n");
368 $action= "Removed annotation that $gBug had been forwarded to $s_forwarded.";
370 &addmaintainers($s_package);
372 } while (&getnextbug);
375 } elsif (m/^severity\s+\#?(\d+)\s+([-0-9a-z]+)$/i ||
376 m/^priority\s+\#?(\d+)\s+([-0-9a-z]+)$/i) {
380 if (!grep($_ eq $newseverity, @severities, "$gDefaultSeverity")) {
381 &transcript("Severity level \`$newseverity' is not known.\n".
382 "Recognised are: ".join(' ',@showseverities).".\n\n");
384 $printseverity= $s_severity;
385 $printseverity= "$gDefaultSeverity" if $printseverity eq '';
386 $action= "Severity set to \`$newseverity'.";
388 &addmaintainers($s_package);
389 $s_severity= $newseverity;
390 } while (&getnextbug);
392 } elsif (m/^retitle\s+\#?(\d+)\s+(\S.*\S)\s*$/i) {
394 $ref= $1; $newtitle= $2;
397 &addmaintainers($s_package);
398 $s_subject= $newtitle;
399 $action= "Changed $gBug title.";
401 &transcript("$action\n");
402 if (length($s_done)) {
403 &transcript("(By the way, that $gBug is currently marked as done.)\n");
409 } elsif (m/^unmerge\s+\#?(\d+)$/i) {
413 if (!length($s_mergedwith)) {
414 &transcript("$gBug is not marked as being merged with any others.\n\n");
417 $mergelowstate eq 'locked' || die "$mergelowstate ?";
418 $action= "Disconnected #$ref from all other report(s).";
419 @newmergelist= split(/ /,$s_mergedwith);
422 &addmaintainers($s_package);
423 $s_mergedwith= ($ref == $discref) ? ''
424 : join(' ',grep($_ ne $ref,@newmergelist));
425 } while (&getnextbug);
428 } elsif (m/^merge\s+(\d+(\s+\d+)+)\s*$/i) {
430 @tomerge= sort { $a <=> $b } split(/\s+/,$1);
433 while (defined($ref= shift(@tomerge))) {
434 &transcript("D| checking merge $ref\n") if $dl;
436 next if grep($_ eq $ref,@newmergelist);
437 if (!&getbug) { ¬foundbug; @newmergelist=(); last }
439 &transcript("D| adding $ref ($s_mergewith)\n") if $dl;
441 &checkmatch('package','m_package',$s_package);
442 &checkmatch('forwarded addr','m_forwarded',$s_forwarded);
443 &checkmatch('severity','m_severity',$s_severity);
444 &checkmatch('done mark','m_done',length($s_done) ? 'done' : 'open');
445 if (length($mismatch)) {
446 &transcript("Mismatch - only $Bugs in same state can be merged:\n".
448 &cancelbug; @newmergelist=(); last;
450 push(@newmergelist,$ref);
451 push(@tomerge,split(/ /,$s_mergedwith));
455 @newmergelist= sort { $a <=> $b } @newmergelist;
456 $action= "Merged @newmergelist.";
457 for $ref (@newmergelist) {
458 &getbug || die "huh ? $gBug $ref disappeared during merge";
459 &addmaintainers($s_package);
460 $s_mergedwith= join(' ',grep($_ ne $ref,@newmergelist));
463 &transcript("$action\n\n");
467 &transcript("Unknown command or malformed arguments to command.\n\n");
468 if (++$unknowns >= 5) {
469 &transcript("Too many unknown commands, stopping here.\n\n");
474 if ($procline>$#msg) {
475 &transcript(">\nEnd of message, stopping processing here.\n\n");
478 &transcript("No commands successfully parsed; sending the help text(s).\n");
483 &transcript("MC\n") if $dl>1;
485 for $maint (keys %maintccreasons) {
486 &transcript("MM|$maint|\n") if $dl>1;
487 next if $maint eq $replyto;
489 $reasonsref= $maintccreasons{$maint};
490 &transcript("MY|$maint|\n") if $dl>2;
491 for $p (sort keys %$reasonsref) {
492 &transcript("MP|$p|\n") if $dl>2;
493 $reasonstring.= ', ' if length($reasonstring);
494 $reasonstring.= $p.' ' if length($p);
495 $reasonstring.= join(' ',map("#$_",sort keys %{$$reasonsref{$p}}));
497 push(@maintccs,"$maint ($reasonstring)");
498 push(@maintccaddrs,"$maint");
501 &transcript("MC|@maintccs|\n") if $dl>2;
502 $maintccs= "Cc: ".join(",\n ",@maintccs)."\n";
503 } else { $maintccs = ""; }
506 From: $gMaintainerEmail ($gProject $gBug Tracking System)
508 ${maintccs}Subject: Processed: $header{'subject'}
509 In-Reply-To: $header{'message-id'}
510 References: $header{'message-id'}
511 Message-ID: <handler.s.$nn.transcript\@$gEmailDomain>
513 ${transcript}Please contact me if you need assistance.
516 (administrator, $gProject $gBugs database)
520 $repliedshow= join(', ',$replyto,@maintccaddrs);
521 &filelock("lock/-1");
522 open(AP,">>db/-1.log") || &quit("open db/-1.log: $!");
524 "\2\n$repliedshow\n\5\n$reply\n\3\n".
526 "<strong>Request received</strong> from <code>".
527 &sani($header{'from'})."</code>\n".
528 "to <code>".&sani($controlrequestaddr)."</code>\n".
530 "\7\n",@log,"\n\3\n") || &quit("writing db/-1.log: $!");
531 close(AP) || &quit("open db/-1.log: $!");
533 utime(time,time,"db");
535 &sendmailmessage($reply,$replyto,@maintccaddrs);
537 unlink("incoming/P$nn") || &quit("unlinking incoming/P$nn: $!");
541 map { $_->address() }
542 map { Mail::Address->parse($_) } @_;
545 sub sendmailmessage {
546 local ($message,@recips) = @_;
547 print "mailing to >@recips<\n" if $debug;
549 defined($c) || &quit("mailing forking for sendmail: $!");
550 if (!$c) { # ie, we are the child process
551 exec '/usr/lib/sendmail','-f'."$gMaintainerEmail",'-odi','-oem','-oi',get_addresses(@recips);
554 print(D $message) || &quit("writing to sendmail process: $!");
555 $!=0; close(D); $? && &quit("sendmail gave exit status $? ($!)");
560 &sendtxthelpraw("bug-log-mailserver.txt","instructions for request\@$gEmailDomain");
561 &sendtxthelpraw("bug-maint-mailcontrol.txt","instructions for control\@$gEmailDomain")
566 # &transcript("Sorry, command $_[0] not yet implemented.\n\n");
570 local ($string,$mvarname,$svarvalue) = @_;
573 eval "\$mvarvalue= \$$mvarname";
574 &transcript("D| checkmatch \`$string' /$mvarname/$mvarvalue/$svarvalue/\n")
577 "Values for \`$string' don't match:\n".
578 " #$newmergelist[0] has \`$mvarvalue';\n".
579 " #$ref has \`$svarvalue'\n"
580 if $mvarvalue ne $svarvalue;
582 &transcript("D| setupmatch \`$string' /$mvarname/$svarvalue/\n")
584 eval "\$$mvarname= \$svarvalue";
588 # High-level bug manipulation calls
589 # Do announcements themselves
591 # Possible calling sequences:
595 # &transcript(something)
599 # $action= (something)
601 # (modify s_* variables)
602 # } while (getnextbug);
605 &dlen("nochangebug");
606 $state eq 'single' || $state eq 'multiple' || die "$state ?";
608 &endmerge if $manybugs;
610 &dlex("nochangebug");
614 &dlen("setbug $ref");
615 $state eq 'idle' || die "$state ?";
618 &dlex("setbug => 0s");
621 @thisbugmergelist= split(/ /,$s_mergedwith);
622 if (!@thisbugmergelist) {
627 &dlex("setbug => 1s");
636 &dlex("setbug => 0mc");
640 $state= 'multiple'; $sref=$ref;
641 &dlex("setbug => 1m");
647 $state eq 'single' || $state eq 'multiple' || die "$state ?";
649 if (!$manybugs || !@thisbugmergelist) {
650 length($action) || die;
651 &transcript("$action\n$extramessage\n");
652 &endmerge if $manybugs;
654 &dlex("getnextbug => 0");
657 $ref= shift(@thisbugmergelist);
658 &getbug || die "bug $ref disappeared";
660 &dlex("getnextbug => 1");
664 # Low-level bug-manipulation calls
665 # Do no announcements
673 # $action= (something)
678 # [getbug (returns 0)]
679 # &transcript("$action\n\n")
682 sub notfoundbug { &transcript("$gBug number $ref not found.\n\n"); }
683 sub foundbug { &transcript("$gBug#$ref: $s_subject\n"); }
687 $mergelowstate eq 'idle' || die "$mergelowstate ?";
688 &filelock('lock/merge');
689 $mergelowstate='locked';
695 $mergelowstate eq 'locked' || die "$mergelowstate ?";
697 $mergelowstate='idle';
702 &dlen("getbug $ref");
703 $lowstate eq 'idle' || die "$state ?";
704 if (&lockreadbug($ref)) {
707 &dlex("getbug => 1");
712 &dlex("getbug => 0");
718 $lowstate eq 'open' || die "$state ?";
725 &dlen("savebug $ref");
726 $lowstate eq 'open' || die "$lowstate ?";
727 length($action) || die;
728 $ref == $sref || die "read $sref but saving $ref ?";
729 open(L,">>db/$ref.log") || &quit("opening db/$ref.log: $!");
732 "<strong>".&sani($action)."</strong>\n".
733 "Request was from <code>".&sani($header{'from'})."</code>\n".
734 "to <code>".&sani($controlrequestaddr)."</code>. \n".
736 "\7\n",@log,"\n\3\n") || &quit("writing db/$ref.log: $!");
737 close(L) || &quit("closing db/$ref.log: $!");
738 open(S,">db/$ref.status.new") || &quit("opening db/$ref.status.new: $!");
749 "$s_severity\n") || &quit("writing db/$ref.status.new: $!");
750 close(S) || &quit("closing db/$ref.status.new: $!");
751 rename("db/$ref.status.new","db/$ref.status") ||
752 &quit("installing new db/$ref.status: $!");
760 &transcript("C> @_ ($state $lowstate $mergelowstate)\n");
765 &transcript("R> @_ ($state $lowstate $mergelowstate)\n");
769 print $_[0] if $debug;
786 local ($relpath,$description) = @_;
788 open(D,"$gDocDir/$relpath") || &quit("open doc file $relpath: $!");
789 while(<D>) { $doc.=$_; }
791 &transcript("Sending $description in separate message.\n");
792 &sendmailmessage(<<END.$doc,$replyto);
793 From: $gMaintainerEmail ($gProject $gBug Tracking System)
795 Subject: $gProject $gBug help: $description
796 References: $header{'message-id'}
797 In-Reply-To: $header{'message-id'}
798 Message-ID: <handler.s.$nn.help.$midix\@$gEmailDomain>
805 local ($relpath,$description) = @_;
807 open(L,"lynx -nolist -dump $wwwbase/$relpath 2>&1 |") || &quit("fork for lynx: $!");
808 while(<L>) { $doc.=$_; }
810 if ($? == 255 && $doc =~ m/^\n*lynx: Can\'t access start file/) {
811 &transcript("Information ($description) is not available -\n".
812 "perhaps the $gBug does not exist or is not on the WWW yet.\n");
815 &transcript("Error getting $description (code $? $!):\n$doc\n");
817 &transcript("Sending $description.\n");
818 &sendmailmessage(<<END.$doc,$replyto);
819 From: $gMaintainerEmail ($gProject $gBug Tracking System)
821 Subject: $gProject $gBugs information: $description
822 References: $header{'message-id'}
823 In-Reply-To: $header{'message-id'}
824 Message-ID: <handler.s.$nn.info.$midix\@$gEmailDomain>
833 $maintccreasons{$cca}{''}{$ref}= 1;
837 { # Data structure is:
838 # maintainer email address &c -> assoc of packages -> assoc of bug#'s
839 my ($p, $addmaint, $pshow);
840 &ensuremaintainersloaded;
841 $anymaintfound=0; $anymaintnotfound=0;
842 for $p (split(m/[ \t?,()]+/,$_[0]))
844 $pshow= ($p =~ m/[-+.a-z0-9]+/ ? $& : '');
845 if (defined($maintainerof{$p}))
846 { $addmaint= $maintainerof{$p};
847 &transcript("MR|$addmaint|$p|$ref|\n") if $dl>2;
848 $maintccreasons{$addmaint}{$p}{$ref}= 1;
849 print "maintainer add >$p|$addmaint<\n" if $debug;
850 } else { print "maintainer none >$p<\n" if $debug; }
854 sub ensuremaintainersloaded {
856 return if $maintainersloaded++;
857 open(MAINT,"$gMaintainerFile") || die &quit("maintainers open: $!");
859 m/^(\S+)\s+(\S.*\S)\n$/ || &quit("maintainers bogus \`$_'");
860 $a= $1; $b= $2; $a =~ y/A-Z/a-z/;
861 $maintainerof{$1}= $2;
868 print <<"EOT-EOT-EOT";
869 Syntax: $FILE [options]
870 -c, --config CFGFILE read CFGFILE for configuration (default=./debvote.cfg)
871 -h, --help display this help text
872 -v, --verbose verbose messages
873 -q, --quiet cancels verbose in a config file
874 -V, --version display Debvote version and exit
875 -d, --debug turn debug messages ON (multiple -d for more verbose)