]> git.donarmstrong.com Git - debbugs.git/commitdiff
[project @ 2005-08-22 14:14:45 by ajt]
authorajt <>
Mon, 22 Aug 2005 21:14:45 +0000 (13:14 -0800)
committerajt <>
Mon, 22 Aug 2005 21:14:45 +0000 (13:14 -0800)
support for mindays and maxdays

cgi/common.pl
cgi/pkgreport.cgi

index 06357687d06799bd07973eaabfd6da443d98bea9..2f51b7c463022761c7b43789fc5da25b7a826fb1 100644 (file)
@@ -18,6 +18,8 @@ use Debbugs::MIME qw(decode_rfc1522);
 
 $MLDBM::RemoveTaint = 1;
 
+my $common_mindays = 0;
+my $common_maxdays = -1;
 my $common_archive = 0;
 my $common_repeatmerged = 1;
 my %common_include = ();
@@ -176,6 +178,8 @@ sub set_option {
     if ($opt eq "version") { $common_version = $val; }
     if ($opt eq "dist") { $common_dist = $val; }
     if ($opt eq "arch") { $common_arch = $val; }
+    if ($opt eq "maxdays") { $common_maxdays = $val; }
+    if ($opt eq "mindays") { $common_mindays = $val; }
 }
 
 sub readparse {
@@ -407,6 +411,8 @@ sub urlargs {
     my $args = '';
     $args .= ";archive=yes" if $common_archive;
     $args .= ";repeatmerged=no" unless $common_repeatmerged;
+    $args .= ";mindays=${common_mindays}" unless $common_mindays == 0;
+    $args .= ";maxdays=${common_maxdays}" unless $common_maxdays == -1;
     $args .= ";version=$common_version" if defined $common_version;
     $args .= ";dist=$common_dist" if defined $common_dist;
     $args .= ";arch=$common_arch" if defined $common_arch;
@@ -525,6 +531,9 @@ sub bugfilter($%) {
        return 1 if (bugmatches(%common_exclude, %status));
     }
     my @merged = sort {$a<=>$b} $bug, split(/ /, $status{mergedwith});
+    my $daysold = int((time - $status{date}) / 86400);   # seconds to days
+    return 1 unless ($common_mindays <= $daysold);
+    return 1 unless ($common_maxdays == -1 || $daysold <= $common_maxdays);
     return 1 unless ($common_repeatmerged || !$seenmerged{$merged[0]});
     $seenmerged{$merged[0]} = 1;
     return 0;
index 1f80561e8aec2cbca7e753eb4e9a4e5f5b3826f5..4860c7972612243e8d41f04de19160052dfd18c2 100755 (executable)
@@ -35,6 +35,8 @@ my $pend_exc = $param{'&pend-exc'} || $param{'pend-exc'} || "";
 my $pend_inc = $param{'&pend-inc'} || $param{'pend-inc'} || "";
 my $sev_exc = $param{'&sev-exc'} || $param{'sev-exc'} || "";
 my $sev_inc = $param{'&sev-inc'} || $param{'sev-inc'} || "";
+my $maxdays = ($param{'maxdays'} || -1);
+my $mindays = ($param{'mindays'} || 0);
 my $version = $param{'version'} || undef;
 my $dist = $param{'dist'} || undef;
 my $arch = $param{'arch'} || undef;
@@ -111,6 +113,8 @@ set_option("pend-exc", $pend_exc);
 set_option("pend-inc", $pend_inc);
 set_option("sev-exc", $sev_exc);
 set_option("sev-inc", $sev_inc);
+set_option("maxdays", $maxdays);
+set_option("mindays", $mindays);
 set_option("version", $version);
 set_option("dist", $dist);
 set_option("arch", $arch);