]> git.donarmstrong.com Git - debbugs.git/commitdiff
merge changes from mainline
authorDebian BTS <debbugs@spohr>
Wed, 25 Oct 2006 18:15:37 +0000 (11:15 -0700)
committerDebian BTS <debbugs@spohr>
Wed, 25 Oct 2006 18:15:37 +0000 (11:15 -0700)
cgi/bugreport.cgi
cgi/bugs.css
cgi/pkgreport.cgi
debian/changelog
scripts/process.in
scripts/service.in

index be375255af875e285d9a983b09d4f0bfb15372ae..6851a7e5865dcb0d6f42594b5c300be3dfaef4a0 100755 (executable)
@@ -396,6 +396,7 @@ sub handle_record{
      my $output = '';
      local $_ = $record->{type};
      if (/html/) {
+         my $class = $record->{text} =~ /^<strong>(?:Acknowledgement|Reply|Information|Report|Notification)/ ? 'infmessage':'msgreceived';
          $output .= decode_rfc1522($record->{text});
          # Link to forwarded http:// urls in the midst of the report
          # (even though these links already exist at the top)
@@ -414,7 +415,7 @@ sub handle_record{
          $output .= '<a href="' . bugurl($ref, 'msg='.($msg_number+1)) . '">Full text</a> and <a href="' .
               bugurl($ref, 'msg='.($msg_number+1), 'mbox') . '">rfc822 format</a> available.';
 
-         $output = qq(<div class="msgreceived">\n<a name="$msg_number">\n) . $output . "</div>\n";
+         $output = qq(<div class="$class"><hr>\n<a name="$msg_number">\n) . $output . "</div>\n";
      }
      elsif (/recips/) {
          my ($msg_id) = $record->{text} =~ /^Message-Id:\s+<(.+)>/im;
@@ -424,7 +425,7 @@ sub handle_record{
          elsif (defined $msg_id) {
               $$seen_msg_ids{$msg_id} = 1;
          }
-         $output .= qq(<a name="$msg_number">\n);
+         $output .= qq(<hr><a name="$msg_number">\n);
          $output .= 'View this message in <a href="' . bugurl($ref, "msg=$msg_number", "mbox") . '">rfc822 format</a>';
          $output .= handle_email_message($record->{text},
                                    ref        => $bug_number,
@@ -444,7 +445,7 @@ sub handle_record{
          }
          # Incomming Mail Message
          my ($received,$hostname) = $record->{text} =~ m/Received: \(at (\S+)\) by (\S+)\;/;
-         $output .= qq|<p class="msgreceived"><a name="$msg_number"><a name="msg$msg_number">Message received</a> at |.
+         $output .= qq|<hr><p class="msgreceived"><a name="$msg_number"><a name="msg$msg_number">Message received</a> at |.
               htmlsanit("$received\@$hostname") . q| (<a href="| . bugurl($ref, "msg=$msg_number") . '">full text</a>'.q|, <a href="| . bugurl($ref, "msg=$msg_number") . ';mbox=yes">mbox</a>)'.":</p>\n";
          $output .= handle_email_message($record->{text},
                                    ref        => $bug_number,
@@ -508,7 +509,7 @@ else {
 }
 
 @log = reverse @log if $reverse;
-$log = join('<hr>',@log);
+$log = join("\n",@log);
 
 
 print "Content-Type: text/html; charset=utf-8\n\n";
@@ -518,13 +519,33 @@ my $title = htmlsanit($status{subject});
 my $dummy2 = $debbugs::gWebHostBugDir;
 
 print "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n";
-print "<HTML><HEAD>\n" . 
-    "<TITLE>$short - $title - $debbugs::gProject $debbugs::gBug report logs</TITLE>\n" .
-     '<meta http-equiv="Content-Type" content="text/html;charset=utf-8">'.
-     "<link rel=\"stylesheet\" href=\"$debbugs::gWebHostBugDir/css/bugs.css\" type=\"text/css\">" .
-    "</HEAD>\n" .
-    '<BODY>' .
-    "\n";
+print <<END;
+<HTML><HEAD>
+<TITLE>$short - $title - $debbugs::gProject $debbugs::gBug report logs</TITLE>
+<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
+<link rel="stylesheet" href="$debbugs::gWebHostBugDir/css/bugs.css" type="text/css">
+<script type="text/javascript">
+<!--
+function toggle_infmessages(){
+       var styles = document.styleSheets;
+       var deleted = 0
+       for (var i = 0; i < styles.length; i++) {
+          for (var j = 0; j < styles[i].cssRules.length; j++) {
+            if (styles[i].cssRules[j].cssText == ".infmessage { display: none; }") {
+                 styles[i].deleteRule(j);
+                 deleted = 1;
+            }
+          }
+       }
+       if (!deleted) {
+            styles[0].insertRule(".infmessage { display: none; }",0);
+       }
+}
+-->
+</script>
+</HEAD>
+<BODY">
+END
 print "<H1>" . "$debbugs::gProject $debbugs::gBug report logs - <A HREF=\"mailto:$ref\@$gEmailDomain\">$short</A>" .
       "<BR>" . $title . "</H1>\n";
 
@@ -532,8 +553,8 @@ print "$descriptivehead\n";
 print qq(<p><a href="mailto:$ref\@$debbugs::gEmailDomain">Reply</a> ),
      qq(or <a href="mailto:$ref-subscribe\@$debbugs::gEmailDomain">subscribe</a> ),
      qq(to this bug.</p>\n);
+print qq(<p><a href="javascript:toggle_infmessages();">Show useless messages</a></p>);
 printf "<div class=\"msgreceived\"><p>View this report as an <a href=\"%s\">mbox folder</a>.</p></div>\n", bugurl($ref, "mbox");
-print "<HR>";
 print "$log";
 print "<HR>";
 print "<p class=\"msgreceived\">Send a report that <a href=\"/cgi-bin/bugspam.cgi?bug=$ref\">this bug log contains spam</a>.</p>\n<HR>\n";
index 1f381341b7825a6c6132eb8250f477c6e1e59d8c..ed42581fc96de888417f64974b4ccd7a3bd75cee 100644 (file)
@@ -104,6 +104,16 @@ pre.mime {
     color: #797979;
 }
 
+/* This must be separate from the other CSS to make the showing of
+   unimportant messages work in bugreport.cgi. */ 
+.infmessage { display: none; }
+
+.infmessage {
+    font-family: sans-serif;
+    font-size: 90%;
+    color: #686868;
+}
+
 .msgreceived {
     font-family: sans-serif;
     font-size: 90%;
index cce3fbd4ec62b2644ad954297d1cf05a619127e3..a6c8e8d386037edfa8b20da82afe2b3a8c7336c1 100755 (executable)
@@ -644,12 +644,13 @@ sub pkg_htmlindexentrystatus {
     my $days = 0;
     if (length($status{done})) {
         $result .= "<br><strong>Done:</strong> " . htmlsanit($status{done});
-        $days = ceil($debbugs::gRemoveAge - -M buglog($status{id}));
-        if ($days >= 0) {
-            $result .= ";\n<strong>Will be archived" . ( $days == 0 ? " today" : $days == 1 ? " in $days day" : " in $days days" ) . "</strong>";
-        } else {
-            $result .= ";\n<strong>Archived</strong>";
-        }
+# Disabled until archiving actually works again
+#        $days = ceil($debbugs::gRemoveAge - -M buglog($status{id}));
+#         if ($days >= 0) {
+#             $result .= ";\n<strong>Will be archived" . ( $days == 0 ? " today" : $days == 1 ? " in $days day" : " in $days days" ) . "</strong>";
+#         } else {
+#             $result .= ";\n<strong>Archived</strong>";
+#         }
     }
 
     unless (length($status{done})) {
@@ -846,7 +847,7 @@ sub pkg_javascript {
 <!--
 function pagemain() {
        toggle(1);
-       toggle(2);
+//     toggle(2);
        enable(1);
 }
 
@@ -895,10 +896,12 @@ function save_cat_cookies() {
 
 function toggle(i) {
         var a = document.getElementById("a_" + i);
-        if (a.style.display == "none") {
-                a.style.display = "";
-        } else {
-                a.style.display = "none";
+        if (a) {
+             if (a.style.display == "none") {
+                     a.style.display = "";
+             } else {
+                     a.style.display = "none";
+             }
         }
 }
 
index a6edc9c7bed549034926dedf3cf770f22f3c528f..06efe83d0a447e07a1eabe9c7aba2d1dae2b57de 100644 (file)
@@ -132,6 +132,11 @@ debbugs (2.4.2) UNRELEASED; urgency=low
     - Stop refering to developers on the index page (closes: #355786)
     - Change control@ stop regex and documentation to match eachother
       (closes: #366093)
+    - Make it obvious when commands to control have failed
+      (closes: #344184)
+    - Fix javascript error in pkgreport.cgi (closes: #346043)
+    - When a bug can't be found in control@; indicate to user that it may
+      be archived. (closes: #153536)
 
   
  -- Colin Watson <cjwatson@debian.org>  Fri, 20 Jun 2003 18:57:25 +0100
index 6569260f0514b5fa920433f71b75285c3411f582..c977e798aae4694cf7b7342a5cacdea1ea9dc178 100755 (executable)
@@ -668,7 +668,7 @@ END
                        $user_tags{$tag} = [keys %bugs_with_tag];
                   }
              }
-             write_usertags(\%usertags,$user);
+             write_usertags(\%user_tags,$user);
         }
         else {
              $brokenness .=<<END;
index a37b5bacacf6c7f4146c49d2e4f85f86783b0f80..4d0b4645451074c64484a1ee0e6af84e149ba5b1 100755 (executable)
@@ -121,6 +121,8 @@ if ( defined($header{'reply-to'}) && $header{'reply-to'} ne "" ) {
     $replyto = $header{'from'};
 }
 
+# This is an error counter which should be incremented every time there is an error.
+my $errors = 0;
 $controlrequestaddr= $control ? "control\@$gEmailDomain" : "request\@$gEmailDomain";
 $transcript='';
 &transcript("Processing commands for $controlrequestaddr:\n\n");
@@ -183,12 +185,15 @@ for ($procline=0; $procline<=$#bodylines; $procline++) {
                     "detailed logs for $gBug#$ref");
     } elsif (m/^index(\s+full)?$/i) {
        &transcript("This BTS function is currently disabled, sorry.\n\n");
+       $errors++;
        $ok++; # well, it's not really ok, but it fixes #81224 :)
     } elsif (m/^index-summary\s+by-package$/i) {
        &transcript("This BTS function is currently disabled, sorry.\n\n");
+       $errors++;
        $ok++; # well, it's not really ok, but it fixes #81224 :)
     } elsif (m/^index-summary(\s+by-number)?$/i) {
        &transcript("This BTS function is currently disabled, sorry.\n\n");
+       $errors++;
        $ok++; # well, it's not really ok, but it fixes #81224 :)
     } elsif (m/^index(\s+|-)pack(age)?s?$/i) {
        &sendlynxdoc("pkgindex.cgi?indexon=pkg",'index of packages');
@@ -206,12 +211,15 @@ for ($procline=0; $procline<=$#bodylines; $procline++) {
         $ok++;
     } elsif (m/^send-unmatched(\s+this|\s+-?0)?$/i) {
        &transcript("This BTS function is currently disabled, sorry.\n\n");
+       $errors++;
        $ok++; # well, it's not really ok, but it fixes #81224 :)
     } elsif (m/^send-unmatched\s+(last|-1)$/i) {
        &transcript("This BTS function is currently disabled, sorry.\n\n");
+       $errors++;
        $ok++; # well, it's not really ok, but it fixes #81224 :)
     } elsif (m/^send-unmatched\s+(old|-2)$/i) {
        &transcript("This BTS function is currently disabled, sorry.\n\n");
+       $errors++;
        $ok++; # well, it's not really ok, but it fixes #81224 :)
     } elsif (m/^getinfo\s+([\w-.]+)$/i) {
         # the following is basically a Debian-specific kludge, but who cares
@@ -252,6 +260,7 @@ END
            $user = $newuser;
        } else {
            &transcript("Selected user id ($newuser) invalid, sorry\n");
+           $errors++;
            $user = "";
        }
     } elsif (m/^usercategory\s+(\S+)(\s+\[hidden\])?\s*$/i) {
@@ -273,6 +282,7 @@ END
             my ($o, $txt) = ($1, $2);
             if ($#cats == -1 && $o eq "+") {
                 &transcript("User defined category specification must start with a category name. Skipping.\n\n");
+               $errors++;
                 $bad = 1;
                 next;
             }
@@ -291,6 +301,7 @@ END
                     $desc = ""; $op = $1;
                 } else {
                     &transcript("Unrecognised syntax for category section. Skipping.\n\n");
+                   $errors++;
                     $bad = 1;
                     next;
                 }
@@ -334,6 +345,7 @@ END
        $ref = $1; $addsubcode = $3 || "+"; $tags = $4;
        if ($user eq "") {
            &transcript("No valid user selected\n");
+           $errors++;
         } elsif (&setbug) {
            &nochangebug;
            my %ut;
@@ -349,6 +361,7 @@ END
            }
            if (@badtags) {
                 &transcript("Ignoring illegal tag/s: ".join(', ', @badtags).".\nPlease use only alphanumerics, at, dot, plus and dash.\n");
+               $errors++;
            }
             for my $t (keys %chtags) {
                $ut{$t} = [] unless defined $ut{$t};
@@ -378,6 +391,7 @@ Unknown command or malformed arguments to command.
 (Use control\@$gEmailDomain to manipulate reports.)
 
 END
+       $errors++;
         if (++$unknowns >= 3) {
             &transcript("Too many unknown commands, stopping here.\n\n");
             last;
@@ -497,6 +511,7 @@ END
         if (&setbug) {
             if (!length($data->{done}) and not defined($version)) {
                 &transcript("$gBug is already open, cannot reopen.\n\n");
+               $errors++;
                 &nochangebug;
             } else {
                 $action=
@@ -645,9 +660,11 @@ END
         if (!grep($_ eq $newseverity, @gSeverityList, "$gDefaultSeverity")) {
             &transcript("Severity level \`$newseverity' is not known.\n".
                        "Recognized are: $gShowSeverities.\n\n");
+           $errors++;
         } elsif (exists $gObsoleteSeverities{$newseverity}) {
             &transcript("Severity level \`$newseverity' is obsolete. " .
-                        "$gObsoleteSeverities{$newseverity}\n\n");
+                        "Use $gObsoleteSeverities{$newseverity} instead.\n\n");
+               $errors++;
         } elsif (&setbug) {
             $printseverity= $data->{severity};
             $printseverity= "$gDefaultSeverity" if $printseverity eq '';
@@ -682,6 +699,7 @@ END
        if (@badtags) {
             &transcript("Unknown tag/s: ".join(', ', @badtags).".\n".
                        "Recognized are: ".join(' ', @gTags).".\n\n");
+           $errors++;
        }
        if (&setbug) {
            if ($data->{keywords} eq '') {
@@ -759,6 +777,7 @@ END
        }
        if (@badblockers) {
             &transcript("Unknown blocking bug/s: ".join(', ', @badblockers).".\n");
+           $errors++;
        }
        
        $ref=$bugnum;
@@ -897,6 +916,7 @@ END
            if (length($mismatch)) {
                &transcript("Mismatch - only $gBugs in same state can be merged:\n".
                             $mismatch."\n");
+               $errors++;
                &cancelbug; @newmergelist=(); last;
            }
             push(@newmergelist,$ref);
@@ -952,6 +972,7 @@ END
            if ($data->{package} ne $master_bug_data->{package}) {
                &transcript("Mismatch - only $gBugs in the same package can be forcibly merged:\n".
                            "$gBug $ref is not in the same package as $master_bug\n");
+               $errors++;
                &cancelbug; @newmergelist=(); last;
            }
            for my $t (split /\s+/,$data->{keywords}) {
@@ -993,7 +1014,8 @@ END
        $bug_affected{$ref} = 1;
        if (&setbug) {
            if (length($data->{mergedwith})) {
-               &transcript("$gBug is marked as being merged with others.\n\n");
+               &transcript("$gBug is marked as being merged with others. Use an existing clone.\n\n");
+               $errors++;
                &nochangebug;
            } else {
                &filelock("nextnumber.lock");
@@ -1095,6 +1117,7 @@ END
         }
     } else {
         &transcript("Unknown command or malformed arguments to command.\n\n");
+       $errors++;
         if (++$unknowns >= 5) {
             &transcript("Too many unknown commands, stopping here.\n\n");
             last;
@@ -1105,6 +1128,7 @@ if ($procline>$#bodylines) {
     &transcript(">\nEnd of message, stopping processing here.\n\n");
 }
 if (!$ok && !quickabort) {
+    $errors++;
     &transcript("No commands successfully parsed; sending the help text(s).\n");
     &sendhelp;
     &transcript("\n");
@@ -1145,10 +1169,13 @@ 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)":'';
+
 $reply= <<END;
 From: $gMaintainerEmail ($gProject $gBug Tracking System)
 To: $replyto
-${maintccs}Subject: Processed: $header{'subject'}
+${maintccs}Subject: Processed${error_text}: $header{'subject'}
 In-Reply-To: $header{'message-id'}
 References: $header{'message-id'}
 Message-ID: <handler.s.$nn.transcript\@$gEmailDomain>
@@ -1222,6 +1249,7 @@ sub checkmatch {
 sub checkpkglimit {
     if (keys %limit_pkgs and not defined $limit_pkgs{$data->{package}}) {
         &transcript("$gBug number $ref belongs to package $data->{package}, skipping.\n\n");
+        $errors++;
         return 0;
     }
     return 1;
@@ -1350,7 +1378,7 @@ sub getnextbug {
 #    &transcript("$action\n\n")
 #    endmerge
 
-sub notfoundbug { &transcript("$gBug number $ref not found.\n\n"); }
+sub notfoundbug { &transcript("$gBug number $ref not found. (Is it archived?)\n\n"); }
 sub foundbug { &transcript("$gBug#$ref: $data->{subject}\n"); }
 
 sub getmerge {