X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scripts%2Fservice;h=df3bc2c04b070a26063728c00f3e7344f0bf75bb;hb=refs%2Fheads%2Fmaster;hp=10fbbc0a2488c3abc6f772e790bb2e0b5231e21f;hpb=fd28ccea72e13b7e2dd7323af7c0cbaad9bb6663;p=debbugs.git diff --git a/scripts/service b/scripts/service index 10fbbc0..df3bc2c 100755 --- a/scripts/service +++ b/scripts/service @@ -7,7 +7,6 @@ use warnings; use strict; -use locale; use POSIX qw(strftime locale_h); setlocale(LC_TIME, "C"); @@ -33,14 +32,14 @@ use Debbugs::Versions::Dpkg; use Debbugs::Status qw(splitpackages); use Debbugs::CGI qw(html_escape); -use Debbugs::Control qw(:all); +use Debbugs::Control qw(:all valid_usertag); use Debbugs::Control::Service qw(:all); use Debbugs::Log qw(:misc); use Debbugs::Text qw(:templates); use Scalar::Util qw(looks_like_number); -use List::Util qw(first); +use List::AllUtils qw(first uniqnum); use Mail::RFC822::Address; use Encode qw(decode encode); @@ -285,7 +284,7 @@ for ($procline=0; $procline<=$#bodylines; $procline++) { } elsif (m/^subscribe/i) { print {$transcript} < "$gMaintainerEmail ($gProject $gBug Tracking System)", + create_mime_message([From => qq("$gProject $gBug Tracking System" <$gMaintainerEmail>), To => $replyto, @maintccs ? (Cc => join(', ',@maintccs)):(), Subject => "Processed${error_text}: $header{subject}", @@ -574,20 +577,15 @@ sub fill_template{ my $variables = {config => \%config, defined($ref)?(ref => $ref):(), defined($data)?(data => $data):(), - refs => [map {exists $clonebugs{$_}?$clonebugs{$_}:$_} keys %bug_affected], + refs => [sort + uniqnum(defined($ref)?($ref):(), + map {exists $clonebugs{$_}?$clonebugs{$_}:$_} + keys %bug_affected)], %{$extra_var}, }; - my $hole_var = {'&bugurl' => - sub{"$_[0]: ". - 'http://'.$config{cgi_domain}.'/'. - Debbugs::CGI::bug_links(bug=>$_[0], - links_only => 1, - ); - } - }; return fill_in_template(template => $template, variables => $variables, - hole_var => $hole_var, + output_type => 'text', ); } @@ -885,7 +883,7 @@ sub sendtxthelpraw { close(D); print {$transcript} "Sending $description in separate message.\n"; &sendmailmessage(< To: $replyto Subject: $gProject $gBug help: $description References: $header{'message-id'} @@ -901,7 +899,7 @@ END sub sendlynxdocraw { my ($relpath,$description) = @_; $doc=''; - open(L,"lynx -nolist -dump http://$gCGIDomain/\Q$relpath\E 2>&1 |") || die "fork for lynx: $!"; + open(L,"lynx -nolist -dump $gCGIDomain/\Q$relpath\E 2>&1 |") || die "fork for lynx: $!"; while() { $doc.=$_; } $!=0; close(L); if ($? == 255 && $doc =~ m/^\n*lynx: Can\'t access start file/) { @@ -913,7 +911,7 @@ sub sendlynxdocraw { } else { print {$transcript} "Sending $description.\n"; &sendmailmessage(< To: $replyto Subject: $gProject $gBugs information: $description References: $header{'message-id'} @@ -950,7 +948,7 @@ sub sendinfo { } print {$transcript} "Sending $description.\n"; &sendmailmessage(< To: $replyto Subject: $gProject $gBugs information: $description References: $header{'message-id'}