]> git.donarmstrong.com Git - debbugs.git/blobdiff - scripts/service
Include the protocol (http://) in gWebDomain and gCGIDomain
[debbugs.git] / scripts / service
index d736121522c00fd0fb3552f9724b449189532f77..0059ef76df79bd1d5811163611bcc2219d7d6134 100755 (executable)
@@ -7,6 +7,9 @@
 use warnings;
 use strict;
 
+use locale;
+use POSIX qw(strftime locale_h);
+setlocale(LC_TIME, "C");
 
 use Debbugs::Config qw(:globals :config);
 
@@ -170,11 +173,6 @@ my %clonebugs = ();
 my %bcc = ();
 
 
-my @bcc;
-sub addbcc {
-    push @bcc, $_[0] unless grep { $_ eq $_[0] } @bcc;
-}
-
 our $data;
 our $message;
 our $extramessage;
@@ -287,7 +285,7 @@ for ($procline=0; $procline<=$#bodylines; $procline++) {
     } elsif (m/^subscribe/i) {
         print {$transcript} <<END;
 There is no $gProject $gBug mailing list.  If you wish to review bug reports
-please do so via http://$gWebDomain/ or ask this mail server
+please do so via $gWebDomain or ask this mail server
 to send them to you.
 soon: MAILINGLISTS_TEXT
 END
@@ -478,11 +476,13 @@ END
                         transcript => $transcript,
                         debug => $debug,
                         ok => \$ok,
+                        replyto => $replyto,
                        );
        if ($terminate_control) {
            last;
        }
     } else {
+       print {$transcript} "Unknown command or malformed arguments to command.\n";
        $errors++;
         if (++$unknowns >= 5) {
             print {$transcript} "Too many unknown commands, stopping here.\n\n";
@@ -504,30 +504,17 @@ my @maintccs = determine_recipients(recipients => \%recipients,
                                    address_only => 1,
                                    cc => 1,
                                   );
-my $maintccs = 'Cc: '.join(",\n    ",
-                   determine_recipients(recipients => \%recipients,
-                                        cc => 1,
-                                       )
-                  )."\n";
-
-my $packagepr = '';
-$packagepr = "X-${gProject}-PR-Package: " . join(keys %affected_packages) . "\n" if keys %affected_packages;
-
-# Add Bcc's to subscribed bugs
-# now handled by Debbugs::Recipients
-#push @bcc, map {"bugs=$_\@$gListDomain"} keys %bug_affected;
-
 if (!defined $header{'subject'} || $header{'subject'} eq "") {
   $header{'subject'} = "your mail";
 }
 
 # Error text here advertises how many errors there were
-my $error_text = $errors > 0 ? " (with $errors errors)":'';
+my $error_text = $errors > 0 ? " (with $errors error" . ($errors > 1 ? "s" : "") . ")" : "";
 
 my @common_headers;
 push @common_headers, 'X-Loop',$gMaintainerEmail;
 
-my $temp_transcript = ${transcript_scalar};
+my $temp_transcript = $transcript_scalar;
 eval{
     $temp_transcript = decode("utf8",$temp_transcript,Encode::FB_CROAK);
 };
@@ -560,19 +547,6 @@ my $repliedshow= join(', ',$replyto,
                                          )
                     );
 
-# -1 is the service.in log
-&filelock("lock/-1");
-open(AP,">>db-h/-1.log") || die "open db-h/-1.log: $!";
-print(AP
-      "\2\n$repliedshow\n\5\n$reply\n\3\n".
-      "\6\n".
-      "<strong>Request received</strong> from <code>".
-      html_escape($header{'from'})."</code>\n".
-      "to <code>".html_escape($controlrequestaddr)."</code>\n".
-      "\3\n".
-      "\7\n",escape_log(@log),"\n\3\n") || die "writing db-h/-1.log: $!";
-close(AP) || die "open db-h/-1.log: $!";
-&unfilelock;
 utime(time,time,"db-h");
 
 &sendmailmessage($reply,
@@ -605,7 +579,7 @@ sub fill_template{
                     };
      my $hole_var = {'&bugurl' =>
                     sub{"$_[0]: ".
-                             'http://'.$config{cgi_domain}.'/'.
+                             $config{cgi_domain}.'/'.
                                   Debbugs::CGI::bug_links(bug=>$_[0],
                                                           links_only => 1,
                                                          );
@@ -927,7 +901,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(<L>) { $doc.=$_; }
     $!=0; close(L);
     if ($? == 255 && $doc =~ m/^\n*lynx: Can\'t access start file/) {