]> git.donarmstrong.com Git - debbugs.git/blobdiff - cgi/pkgreport.cgi
merge changes from dla source tree
[debbugs.git] / cgi / pkgreport.cgi
index 87525d91ab3f22c3d57b967404313d6f4f0b849c..ed67c54d13ae088111975594dd8c135e03f6792b 100755 (executable)
@@ -35,11 +35,15 @@ my $users = $param{'users'} || "";
 my $ordering = $param{'ordering'};
 my $raw_sort = ($param{'raw'} || "no") eq "yes";
 my $old_view = ($param{'oldview'} || "no") eq "yes";
+my $age_sort = ($param{'age'} || "no") eq "yes";
 unless (defined $ordering) {
    $ordering = "normal";
    $ordering = "oldview" if $old_view;
    $ordering = "raw" if $raw_sort;
+   $ordering = 'age' if $age_sort;
 }
+my ($bug_order) = $ordering =~ /(age(?:rev)?)/;
+$bug_order = '' if not defined $bug_order;
 
 my $bug_rev = ($param{'bug-rev'} || "no") eq "yes";
 my $pend_rev = ($param{'pend-rev'} || "no") eq "yes";
@@ -520,6 +524,7 @@ my $sel_rmn = ($repeatmerged ? "" : " selected");
 my $sel_ordraw = ($ordering eq "raw" ? " selected" : "");
 my $sel_ordold = ($ordering eq "oldview" ? " selected" : "");
 my $sel_ordnor = ($ordering eq "normal" ? " selected" : "");
+my $sel_ordage = ($ordering eq "age" ? " selected" : "");
 
 my $chk_bugrev = ($bug_rev ? " checked" : "");
 my $chk_pendrev = ($pend_rev ? " checked" : "");
@@ -543,6 +548,7 @@ print <<EOF;
 <option value=raw$sel_ordraw>bug number only</option>
 <option value=old$sel_ordold>status and severity</option>
 <option value=normal$sel_ordnor>status, severity and classification</option>
+<option value=age$sel_ordage>status, severity, classification, and age</option>
 EOF
 
 {
@@ -644,9 +650,12 @@ sub pkg_htmlindexentrystatus {
                                   status => \%status,
                                   days_until => 1,
                                  );
-        if ($days >= 0) {
-            $result .= ";\n<strong>Will be archived" . ( $days == 0 ? " today" : $days == 1 ? " in $days day" : " in $days days" ) . "</strong>";
+        if ($days >= 0 and defined $status{location} and $status{location} ne 'archive') {
+            $result .= ";\n<strong>Can be archived" . ( $days == 0 ? " today" : $days == 1 ? " in $days day" : " in $days days" ) . "</strong>";
         }
+       elsif (defined $status{location} and $status{location} eq 'archived') {
+            $result .= ";\n<strong>Archived.</strong>";
+       }
     }
 
     unless (length($status{done})) {
@@ -723,20 +732,27 @@ sub pkg_htmlizebugs {
         next unless %status;
         next if bugfilter($bug, %status);
 
-        my $html = sprintf "<li><a href=\"%s\">#%d: %s</a>\n<br>",
+       my $html = sprintf "<li><a href=\"%s\">#%d: %s</a>\n<br>",
             bugurl($bug), $bug, htmlsanit($status{subject});
         $html .= pkg_htmlindexentrystatus(\%status) . "\n";
-
+       push @status, [ $bug, \%status, $html ];
+    }
+    if ($bug_order eq 'age') {
+        # MWHAHAHAHA
+        @status = sort {$a->[1]{log_modified} <=> $b->[1]{log_modified}} @status;
+    }
+    elsif ($bug_order eq 'agerev') {
+        @status = sort {$b->[1]{log_modified} <=> $a->[1]{log_modified}} @status;
+    }
+    for my $entry (@status) {
         my $key = "";
        for my $i (0..$#prior) {
-           my $v = get_bug_order_index($prior[$i], \%status);
+           my $v = get_bug_order_index($prior[$i], $entry->[1]);
             $count{"g_${i}_${v}"}++;
            $key .= "_$v";
        }
-        $section{$key} .= $html;
+        $section{$key} .= $entry->[2];
         $count{"_$key"}++;
-
-        push @status, [ $bug, \%status, $html ];
     }
 
     my $result = "";
@@ -920,7 +936,7 @@ sub pkg_htmlselectyesno {
 sub pkg_htmlselectsuite {
     my $id = sprintf "b_%d_%d_%d", $_[0], $_[1], $_[2];
     my @suites = ("stable", "testing", "unstable", "experimental");
-    my %suiteaka = ("stable", "sarge", "testing", "etch", "unstable", "sid");
+    my %suiteaka = ("stable", "etch", "testing", "lenny", "unstable", "sid");
     my $defaultsuite = "unstable";
 
     my $result = sprintf '<select name=dist id="%s">', $id;