2 # $Id: service.in,v 1.26 2000/10/14 22:22:01 joy Exp $
4 # Usage: service <code>.nn
5 # Temps: incoming/P<code>.nn
8 require('/etc/debbugs/config');
9 require('/usr/lib/debbugs/errorlib');
10 $ENV{'PATH'} = '/usr/lib/debbugs:'.$ENV{'PATH'};
11 chdir("$gSpoolDir") || die "chdir spool: $!\n";
17 m/^[RC]\.\d+$/ || &quit("bad argument");
20 if (!rename("incoming/G$nn","incoming/P$nn"))
21 { $_=$!.''; m/no such file or directory/i && exit 0;
22 &quit("renaming to lock: $!");
25 open(M,"incoming/P$nn");
30 grep((s/\n$//,s/\s+$//),@msg);
32 print "###\n",join("##\n",@msg),"\n###\n" if $debug;
34 chop($tdate= `date -u '+%a, %d %h %Y %T GMT'`);
36 Received: via spool for service; $tdate
39 for ($i=0; $i<=$#msg; $i++)
41 last unless length($_);
43 while ($msg[$i+1] =~ m/^\s/)
45 $fwd .= $msg[$i]."\n" if $ins; # Huh ? Where is ins set ?
48 print ">$_<\n" if $debug;
50 { $v= $1; $v =~ y/A-Z/a-z/;
51 print ">$v=$_<\n" if $debug;
53 } else { print "!>$_<\n" if $debug; }
56 defined($header{'from'}) || &quit("no From header");
57 delete $header{'reply-to'} if ( defined($header{'reply-to'}) && $header{'reply-to'} =~ m/^\s*$/ );
58 if ( defined($header{'reply-to'}) && $header{'reply-to'} ne "" ) {
59 $replyto = $header{'reply-to'};
61 $replyto = $header{'from'};
64 $controlrequestaddr= $control ? "control\@$gEmailDomain" : "request\@$gEmailDomain";
66 &transcript("Processing commands for $controlrequestaddr:\n\n");
71 $mergelowstate= 'idle';
75 #strip blank line(s) after header
76 while ( $i <= $#msg && !length( $msg[$i] ) ) { $fwd .= "\n"; $i++; }
78 #strip, if exists, mime header
79 if ( $msg[$i] =~ /^This is a multi-part message in MIME format./ )
80 { while ( $i <= $#msg && length( $msg[$i] ) ) { $fwd .= $msg[$i] . "\n"; $i++; }
81 while ( $i <= $#msg && !length( $msg[$i] ) ) { $fwd .= "\n"; $i++; }
83 if ( $msg[$i] =~ /^--/ || $msg[$i] =~ /^\s*$/ )
84 { while ( $i <= $#msg && length( $msg[$i] ) ) { $fwd .= $msg[$i]; $i++; }
85 while ( $i <= $#msg && !length( $msg[$i] ) ) { $fwd .= "\n"; $i++; }
89 for ($procline=$i; $procline<=$#msg; $procline++)
90 { $state eq 'idle' || print "$state ?\n";
91 $lowstate eq 'idle' || print "$lowstate ?\n";
92 $mergelowstate eq 'idle' || print "$mergelowstate ?\n";
93 $_= $msg[$procline]; s/\s+$//;
94 next unless m/\S/; next if m/^\s*\#/;
95 &transcript("> $_\n");
97 if (m/^stop/i || m/^quit/i || m/^--/ || m/^thank/i)
98 { &transcript("Stopping processing here.\n\n");
100 } elsif (m/^debug\s+(\d+)$/i && $1 >= 0 && $1 <= 1000) {
102 &transcript("Debug level $dl.\n\n");
103 } elsif (m/^(send|get)\s+\#?(\d{2,})$/i) {
105 &sendlynxdoc("$ref","logs for $gBug#$ref");
106 } elsif (m/^send-detail\s+\#?(\d+)$/i) {
107 $ref= $1+0; $reffile= $ref; $reffile =~ s,^..,$&/$&,;
108 &sendlynxdoc("db/$reffile-b.html","additional logs for $gBug#$ref");
109 } elsif (m/^index(\s+full)?$/i) {
110 &sendlynxdoc("db/ix/full.html",'full index');
111 } elsif (m/^index-summary\s+by-package$/i) {
112 &sendlynxdoc("db/ix/psummary.html",'summary index sorted by package/title');
113 } elsif (m/^index-summary(\s+by-number)?$/i) {
114 &sendlynxdoc("db/ix/summary.html",'summary index sorted by number/date');
115 } elsif (m/^index(\s+|-)pack(age)?s?$/i) {
116 &sendlynxdoc("db/ix/packages.html",'index of packages');
117 } elsif (m/^index(\s+|-)maints?$/i) {
118 &sendlynxdoc("db/ix/maintainers.html",'index of maintainers');
119 } elsif (m/^index(\s+|-)maint\s+(\S.*\S)$/i) {
120 $substrg= $2; $matches=0;
121 opendir(DBD,"$gWebDir/db/ma") || die $!;
122 while (defined($_=readdir(DBD))) {
123 next unless m/^l/ && m/\.html$/;
124 &transcript("F|$_\n") if $dl>1;
125 $filename= $_; s/^l//; s/\.html$//;
126 &transcript("P|$_\n") if $dl>2;
127 while (s/-(..)([^_])/-$1_-$2/) { }
128 &transcript("P|$_\n") if $dl>2;
129 s/^(.{0,2})_/$1-20_/g; while (s/([^-]..)_/$1-20_/) { };
130 &transcript("P|$_\n") if $dl>2;
131 s/^,(.*),(.*),([^,]+)$/$1-40_$2-20_-28_$3-29_/;
132 &transcript("P|$_\n") if $dl>2;
133 s/^([^,]+),(.*),(.*),$/$1-20_-3c_$2-40_$3-3e_/;
134 &transcript("P|$_\n") if $dl>2;
136 &transcript("P|$_\n") if $dl>2;
138 while (m/-(..)_/) { $out.= $`.sprintf("%c",hex($1)); $_=$'; }
140 &transcript("M|$out\n") if $dl>1;
141 next unless index(lc $out, lc $substrg)>=0;
142 &transcript("S|$filename\n") if $dl>0;
143 &transcript("S|$out\n") if $dl>0;
145 &sendlynxdocraw("db/ma/$filename","$gBug list for maintainer \`$out'");
148 &transcript("$gBug list(s) for $matches maintainer(s) sent.\n\n");
150 &transcript("No maintainers found containing \`$substrg'.\n".
151 "Use \`index-maint' to get list of maintainers.\n\n");
154 } elsif (m/^index(\s+|-)pack(age)?s?\s+(\S.*\S)$/i) {
155 $substrg= $+; $matches=0;
156 opendir(DBD,"$gWebDir/db/pa") || die $!;
157 while (defined($_=readdir(DBD))) {
158 next unless m/^l/ && m/\.html$/;
159 &transcript("F|$_\n") if $dl>1;
160 $filename= $_; s/^l//; s/\.html$//;
161 next unless index(lc $_, lc $substrg)>=0;
162 &transcript("S|$filename\n") if $dl>0;
163 &transcript("S|$out\n") if $dl>0;
165 &sendlynxdocraw("db/pa/$filename","$gBug list for package \`$_'");
168 &transcript("$gBug list(s) for $matches package(s) sent.\n\n");
170 &transcript("No packages found containing \`$substrg'.\n".
171 "Use \`index-packages' to get list of packages.\n\n");
174 } elsif (m/^send-unmatched(\s+this|\s+-?0)?$/i) {
175 &sendlynxdoc("db/ju/unmatched-1.html","junk (this week)");
176 } elsif (m/^send-unmatched\s+(last|-1)$/i) {
177 &sendlynxdoc("db/ju/unmatched-2.html","junk (last week)");
178 } elsif (m/^send-unmatched\s+(old|-2)$/i) {
179 &sendlynxdoc("db/ju/unmatched-3.html","junk (two weeks ago)");
180 } elsif (m/^getinfo\s+(\S+)$/i) {
182 if ($file =~ m/^\./ || $file !~ m/^[-.0-9a-z]+$/ || $file =~ m/\.gz$/) {
183 &transcript("Filename $file is badly formatted.\n\n");
184 } elsif (open(P,"$gDocDir/$file")) {
186 &transcript("Info file $file appears below.\n\n");
187 $extras.= "\n---------- Info file $file follows:\n\n";
188 while(<P>) { $extras.= $_; }
191 &transcript("Info file $file does not exist.\n\n");
193 } elsif (m/^help/i) {
197 } elsif (m/^refcard/i) {
198 &sendtxthelp("bug-mailserver-refcard.txt","mailservers' reference card");
199 } elsif (m/^subscribe/i) {
201 There is no $gProject $gBug mailing list. If you wish to review bug reports
202 please do so via http://$gWebDomain/ or ask this mailserver
204 soon: MAILINGLISTS_TEXT
206 } elsif (m/^unsubscribe/i) {
208 soon: UNSUBSCRIBE_TEXT
209 soon: MAILINGLISTS_TEXT
211 } elsif (!$control) {
213 Unknown command or malformed arguments to command.
214 (Use control\@$gEmailDomain to manipulate reports.)
217 if (++$unknowns >= 3) {
218 &transcript("Too many unknown commands, stopping here.\n\n");
221 } elsif (m/^close\s+\#?(\d+)$/i) {
225 if (length($s_done)) {
226 &transcript("$gBug is already closed, cannot re-close.\n\n");
229 $action= "$gBug closed, send any further explanations to $s_originator";
231 &addmaintainers($s_package);
232 if ( length( $gDoneList ) > 0 && length( $gListDomain ) >
233 0 ) { &addccaddress("$gDoneList\@$gListDomain"); }
236 From: $gMaintainerEmail ($gProject $gBug Tracking System)
238 Subject: $gBug#$ref acknowledged by developer
240 References: $header{'message-id'} $s_msgid
241 In-Reply-To: $s_msgid
242 Message-ID: <handler.$ref.$nn.notifdonectrl.$midix\@$gEmailDomain>
244 This is an automatic notification regarding your $gBug report
247 It has been marked as closed by one of the developers, namely
250 You should be hearing from them with a substantive response shortly,
251 if you have not already done so. If not, please contact them
255 (administrator, $gProject $gBugs database)
257 &sendmailmessage($message,$s_originator);
258 } while (&getnextbug);
261 } elsif (m/^reassign\s+\#?(\d+)\s+(\S.*\S)$/i) {
263 $ref= $1; $newpackage= $2;
264 $newpackage =~ y/A-Z/a-z/;
266 if (length($s_package)) {
267 $action= "$gBug reassigned from package \`$s_package'".
268 " to \`$newpackage'.";
270 $action= "$gBug assigned to package \`$newpackage'.";
273 &addmaintainers($s_package);
274 &addmaintainers($newpackage);
275 $s_package= $newpackage;
276 } while (&getnextbug);
278 } elsif (m/^reopen\s+\#?(\d+)$/i ? ($noriginator='', 1) :
279 m/^reopen\s+\#?(\d+)\s+\=$/i ? ($noriginator='', 1) :
280 m/^reopen\s+\#?(\d+)\s+\!$/i ? ($noriginator=$replyto, 1) :
281 m/^reopen\s+\#?(\d+)\s+(\S.*\S)$/i ? ($noriginator=$2, 1) : 0) {
285 if (!length($s_done)) {
286 &transcript("$gBug is already open, cannot reopen.\n\n");
290 $noriginator eq '' ? "$gBug reopened, originator not changed." :
291 "$gBug reopened, originator set to $noriginator.";
293 &addmaintainers($s_package);
294 $s_originator= $noriginator eq '' ? $s_originator : $noriginator;
296 } while (&getnextbug);
299 } elsif (m/^forwarded\s+\#?(\d+)\s+(\S.*\S)$/i) {
301 $ref= $1; $whereto= $2;
303 if (length($s_forwarded)) {
304 $action= "Forwarded-to-address changed from $s_forwarded to $whereto.";
306 $action= "Noted your statement that $gBug has been forwarded to $whereto.";
308 if (length($s_done)) {
309 $extramessage= "(By the way, this $gBug is currently marked as done.)\n";
312 &addmaintainers($s_package);
313 if (length($gFowardList)>0 && length($gListDomain)>0 )
314 { &addccaddress("$gFowardList\@$gListDomain"); }
315 $s_forwarded= $whereto;
316 } while (&getnextbug);
318 } elsif (m/^notforwarded\s+\#?(\d+)$/i) {
322 if (!length($s_forwarded)) {
323 &transcript("$gBug is not marked as having been forwarded.\n\n");
326 $action= "Removed annotation that $gBug had been forwarded to $s_forwarded.";
328 &addmaintainers($s_package);
330 } while (&getnextbug);
333 } elsif (m/^severity\s+\#?(\d+)\s+([-0-9a-z]+)$/i ||
334 m/^priority\s+\#?(\d+)\s+([-0-9a-z]+)$/i) {
338 if (!grep($_ eq $newseverity, @gSeverityList, "$gDefaultSeverity")) {
339 &transcript("Severity level \`$newseverity' is not known.\n".
340 "Recognized are: $gShowSeverities.\n\n");
342 $printseverity= $s_severity;
343 $printseverity= "$gDefaultSeverity" if $printseverity eq '';
344 $action= "Severity set to \`$newseverity'.";
346 &addmaintainers($s_package);
347 $s_severity= $newseverity;
348 } while (&getnextbug);
350 } elsif (m/^tags\s+\#?(\d+)\s+(([=+-])\s+)?(\S.*)?$/) {
352 $ref= $1; $addsubcode= $3; $tags= $4;
354 $addsub = "sub" if ($addsubcode eq "-");
355 $addsub = "add" if ($addsubcode eq "+");
356 $addsub = "set" if ($addsubcode eq "=");
359 foreach my $t (split /[\s,]+/, $tags) {
360 if (!grep($_ eq $t, @gTags)) {
367 &transcript("Unknown tag/s: ".join(', ', @badtags).".\n".
368 "Recognized are: ".join(' ', @gTags).".\n\n");
371 if ($addsub eq "set") {
372 $action= "Tags set to: " . join(", ", @okaytags);
373 } elsif ($addsub eq "add") {
374 $action= "Tags added: " . join(", ", @okaytags);
375 } elsif ($addsub eq "sub") {
376 $action= "Tags removed: " . join(", ", @okaytags);
379 &addmaintainers($s_package);
380 $s_keywords = '' if ($addsub eq "set");
381 if ($addsub eq "sub") {
382 foreach my $t (@badtags) {
383 $s_keywords = join ' ', grep $_ ne $t,
384 split ' ', $s_keywords;
387 foreach my $t (@okaytags) {
388 $s_keywords = join ' ', grep $_ ne $t,
389 split ' ', $s_keywords;
390 $s_keywords = "$t $s_keywords" unless($addsub eq "sub");
392 $s_keywords =~ s/\s*$//;
393 } while (&getnextbug);
395 } elsif (m/^retitle\s+\#?(\d+)\s+(\S.*\S)\s*$/i) {
397 $ref= $1; $newtitle= $2;
400 &addmaintainers($s_package);
401 $s_subject= $newtitle;
402 $action= "Changed $gBug title.";
404 &transcript("$action\n");
405 if (length($s_done)) {
406 &transcript("(By the way, that $gBug is currently marked as done.)\n");
412 } elsif (m/^unmerge\s+\#?(\d+)$/i) {
416 if (!length($s_mergedwith)) {
417 &transcript("$gBug is not marked as being merged with any others.\n\n");
420 $mergelowstate eq 'locked' || die "$mergelowstate ?";
421 $action= "Disconnected #$ref from all other report(s).";
422 @newmergelist= split(/ /,$s_mergedwith);
425 &addmaintainers($s_package);
426 $s_mergedwith= ($ref == $discref) ? ''
427 : join(' ',grep($_ ne $ref,@newmergelist));
428 } while (&getnextbug);
431 } elsif (m/^merge\s+(\d+(\s+\d+)+)\s*$/i) {
433 @tomerge= sort { $a <=> $b } split(/\s+/,$1);
437 while (defined($ref= shift(@tomerge))) {
438 &transcript("D| checking merge $ref\n") if $dl;
440 next if grep($_ eq $ref,@newmergelist);
441 if (!&getbug) { ¬foundbug; @newmergelist=(); last }
443 &transcript("D| adding $ref ($s_mergedwith)\n") if $dl;
445 &checkmatch('package','m_package',$s_package);
446 &checkmatch('forwarded addr','m_forwarded',$s_forwarded);
447 $s_severity = '$gDefaultSeverity' if $s_severity eq '';
448 &checkmatch('severity','m_severity',$s_severity);
449 &checkmatch('done mark','m_done',length($s_done) ? 'done' : 'open');
450 foreach my $t (split /\s+/, $s_keywords) { $tags{$t} = 1; }
451 if (length($mismatch)) {
452 &transcript("Mismatch - only $gBugs in same state can be merged:\n".
454 &cancelbug; @newmergelist=(); last;
456 push(@newmergelist,$ref);
457 push(@tomerge,split(/ /,$s_mergedwith));
461 @newmergelist= sort { $a <=> $b } @newmergelist;
462 $action= "Merged @newmergelist.";
463 for $ref (@newmergelist) {
464 &getbug || die "huh ? $gBug $ref disappeared during merge";
465 &addmaintainers($s_package);
466 $s_mergedwith= join(' ',grep($_ ne $ref,@newmergelist));
467 $s_keywords= join(' ', keys %tags);
470 &transcript("$action\n\n");
474 &transcript("Unknown command or malformed arguments to command.\n\n");
475 if (++$unknowns >= 5) {
476 &transcript("Too many unknown commands, stopping here.\n\n");
481 if ($procline>$#msg) {
482 &transcript(">\nEnd of message, stopping processing here.\n\n");
485 &transcript("No commands successfully parsed; sending the help text(s).\n");
490 &transcript("MC\n") if $dl>1;
492 for $maint (keys %maintccreasons) {
493 &transcript("MM|$maint|\n") if $dl>1;
494 next if $maint eq $replyto;
496 $reasonsref= $maintccreasons{$maint};
497 &transcript("MY|$maint|\n") if $dl>2;
498 for $p (sort keys %$reasonsref) {
499 &transcript("MP|$p|\n") if $dl>2;
500 $reasonstring.= ', ' if length($reasonstring);
501 $reasonstring.= $p.' ' if length($p);
502 $reasonstring.= join(' ',map("#$_",sort keys %{$$reasonsref{$p}}));
504 $reasonstring = "" if (!defined($reasonstring));
505 push(@maintccs,"$maint ($reasonstring)");
506 push(@maintccaddrs,"$maint");
509 &transcript("MC|@maintccs|\n") if $dl>2;
510 $maintccs= "Cc: ".join(",\n ",@maintccs)."\n";
511 } else { $maintccs = ""; }
514 From: $gMaintainerEmail ($gProject $gBug Tracking System)
516 ${maintccs}Subject: Processed: $header{'subject'}
517 In-Reply-To: $header{'message-id'}
518 References: $header{'message-id'}
519 Message-ID: <handler.s.$nn.transcript\@$gEmailDomain>
521 ${transcript}Please contact me if you need assistance.
524 (administrator, $gProject $gBugs database)
528 $repliedshow= join(', ',$replyto,@maintccaddrs);
529 &filelock("lock/-1");
530 open(AP,">>db/-1.log") || &quit("open db/-1.log: $!");
532 "\2\n$repliedshow\n\5\n$reply\n\3\n".
534 "<strong>Request received</strong> from <code>".
535 &sani($header{'from'})."</code>\n".
536 "to <code>".&sani($controlrequestaddr)."</code>\n".
538 "\7\n",@log,"\n\3\n") || &quit("writing db/-1.log: $!");
539 close(AP) || &quit("open db/-1.log: $!");
541 utime(time,time,"db");
543 &sendmailmessage($reply,$replyto,@maintccaddrs);
545 unlink("incoming/P$nn") || &quit("unlinking incoming/P$nn: $!");
549 map { $_->address() }
550 map { Mail::Address->parse($_) } @_;
553 sub sendmailmessage {
554 local ($message,@recips) = @_;
555 print "mailing to >@recips<\n" if $debug;
557 defined($c) || &quit("mailing forking for sendmail: $!");
558 if (!$c) { # ie, we are the child process
559 exec '/usr/lib/sendmail','-f'."$gMaintainerEmail",'-odi','-oem','-oi',get_addresses(@recips);
562 print(D $message) || &quit("writing to sendmail process: $!");
563 $!=0; close(D); $? && &quit("sendmail gave exit status $? ($!)");
568 &sendtxthelpraw("bug-log-mailserver.txt","instructions for request\@$gEmailDomain");
569 &sendtxthelpraw("bug-maint-mailcontrol.txt","instructions for control\@$gEmailDomain")
574 # &transcript("Sorry, command $_[0] not yet implemented.\n\n");
578 local ($string,$mvarname,$svarvalue) = @_;
581 eval "\$mvarvalue= \$$mvarname";
582 &transcript("D| checkmatch \`$string' /$mvarname/$mvarvalue/$svarvalue/\n")
585 "Values for \`$string' don't match:\n".
586 " #$newmergelist[0] has \`$mvarvalue';\n".
587 " #$ref has \`$svarvalue'\n"
588 if $mvarvalue ne $svarvalue;
590 &transcript("D| setupmatch \`$string' /$mvarname/$svarvalue/\n")
592 eval "\$$mvarname= \$svarvalue";
596 # High-level bug manipulation calls
597 # Do announcements themselves
599 # Possible calling sequences:
603 # &transcript(something)
607 # $action= (something)
609 # (modify s_* variables)
610 # } while (getnextbug);
613 &dlen("nochangebug");
614 $state eq 'single' || $state eq 'multiple' || die "$state ?";
616 &endmerge if $manybugs;
618 &dlex("nochangebug");
622 &dlen("setbug $ref");
623 $state eq 'idle' || die "$state ?";
626 &dlex("setbug => 0s");
629 @thisbugmergelist= split(/ /,$s_mergedwith);
630 if (!@thisbugmergelist) {
635 &dlex("setbug => 1s");
644 &dlex("setbug => 0mc");
648 $state= 'multiple'; $sref=$ref;
649 &dlex("setbug => 1m");
655 $state eq 'single' || $state eq 'multiple' || die "$state ?";
657 if (!$manybugs || !@thisbugmergelist) {
658 length($action) || die;
659 &transcript("$action\n$extramessage\n");
660 &endmerge if $manybugs;
662 &dlex("getnextbug => 0");
665 $ref= shift(@thisbugmergelist);
666 &getbug || die "bug $ref disappeared";
668 &dlex("getnextbug => 1");
672 # Low-level bug-manipulation calls
673 # Do no announcements
681 # $action= (something)
686 # [getbug (returns 0)]
687 # &transcript("$action\n\n")
690 sub notfoundbug { &transcript("$gBug number $ref not found.\n\n"); }
691 sub foundbug { &transcript("$gBug#$ref: $s_subject\n"); }
695 $mergelowstate eq 'idle' || die "$mergelowstate ?";
696 &filelock('lock/merge');
697 $mergelowstate='locked';
703 $mergelowstate eq 'locked' || die "$mergelowstate ?";
705 $mergelowstate='idle';
710 &dlen("getbug $ref");
711 $lowstate eq 'idle' || die "$state ?";
712 if (&lockreadbug($ref)) {
715 &dlex("getbug => 1");
720 &dlex("getbug => 0");
726 $lowstate eq 'open' || die "$state ?";
733 &dlen("savebug $ref");
734 $lowstate eq 'open' || die "$lowstate ?";
735 length($action) || die;
736 $ref == $sref || die "read $sref but saving $ref ?";
737 open(L,">>db/$ref.log") || &quit("opening db/$ref.log: $!");
740 "<strong>".&sani($action)."</strong>\n".
741 "Request was from <code>".&sani($header{'from'})."</code>\n".
742 "to <code>".&sani($controlrequestaddr)."</code>. \n".
744 "\7\n",@log,"\n\3\n") || &quit("writing db/$ref.log: $!");
745 close(L) || &quit("closing db/$ref.log: $!");
746 open(S,">db/$ref.status.new") || &quit("opening db/$ref.status.new: $!");
757 "$s_severity\n") || &quit("writing db/$ref.status.new: $!");
758 close(S) || &quit("closing db/$ref.status.new: $!");
759 rename("db/$ref.status.new","db/$ref.status") ||
760 &quit("installing new db/$ref.status: $!");
768 &transcript("C> @_ ($state $lowstate $mergelowstate)\n");
773 &transcript("R> @_ ($state $lowstate $mergelowstate)\n");
777 print $_[0] if $debug;
794 local ($relpath,$description) = @_;
796 open(D,"$gDocDir/$relpath") || &quit("open doc file $relpath: $!");
797 while(<D>) { $doc.=$_; }
799 &transcript("Sending $description in separate message.\n");
800 &sendmailmessage(<<END.$doc,$replyto);
801 From: $gMaintainerEmail ($gProject $gBug Tracking System)
803 Subject: $gProject $gBug help: $description
804 References: $header{'message-id'}
805 In-Reply-To: $header{'message-id'}
806 Message-ID: <handler.s.$nn.help.$midix\@$gEmailDomain>
813 local ($relpath,$description) = @_;
815 open(L,"lynx -nolist -dump http://$gWebDomain/$relpath 2>&1 |") || &quit("fork for lynx: $!");
816 while(<L>) { $doc.=$_; }
818 if ($? == 255 && $doc =~ m/^\n*lynx: Can\'t access start file/) {
819 &transcript("Information ($description) is not available -\n".
820 "perhaps the $gBug does not exist or is not on the WWW yet.\n");
823 &transcript("Error getting $description (code $? $!):\n$doc\n");
825 &transcript("Sending $description.\n");
826 &sendmailmessage(<<END.$doc,$replyto);
827 From: $gMaintainerEmail ($gProject $gBug Tracking System)
829 Subject: $gProject $gBugs information: $description
830 References: $header{'message-id'}
831 In-Reply-To: $header{'message-id'}
832 Message-ID: <handler.s.$nn.info.$midix\@$gEmailDomain>
841 $maintccreasons{$cca}{''}{$ref}= 1;
845 { # Data structure is:
846 # maintainer email address &c -> assoc of packages -> assoc of bug#'s
847 my ($p, $addmaint, $pshow);
848 &ensuremaintainersloaded;
849 $anymaintfound=0; $anymaintnotfound=0;
850 for $p (split(m/[ \t?,()]+/,$_[0]))
852 $pshow= ($p =~ m/[-+.a-z0-9]+/ ? $& : '');
853 if (defined($maintainerof{$p}))
854 { $addmaint= $maintainerof{$p};
855 &transcript("MR|$addmaint|$p|$ref|\n") if $dl>2;
856 $maintccreasons{$addmaint}{$p}{$ref}= 1;
857 print "maintainer add >$p|$addmaint<\n" if $debug;
858 } else { print "maintainer none >$p<\n" if $debug; }
862 sub ensuremaintainersloaded {
864 return if $maintainersloaded++;
865 open(MAINT,"$gMaintainerFile") || die &quit("maintainers open: $!");
869 m/^(\S+)\s+(\S.*\S)\n$/ || &quit("maintainers bogus \`$_'");
870 $a= $1; $b= $2; $a =~ y/A-Z/a-z/;
871 $maintainerof{$1}= $2;