qw(getmaintainers_reverse)
],
misc => [qw(make_list)],
+ date => [qw(secs_to_english)],
quit => [qw(quit)],
lock => [qw(filelock unfilelock @cleanups)],
);
@EXPORT_OK = ();
- Exporter::export_ok_tags(qw(lock quit util misc));
+ Exporter::export_ok_tags(qw(lock quit date util misc));
$EXPORT_TAGS{all} = [@EXPORT_OK];
}
return $_maintainer_rev;
}
+=head1 DATE
+
+ my $english = secs_to_english($seconds);
+ my ($days,$english) = secs_to_english($seconds);
+
+XXX This should probably be changed to use Date::Calc
+
+=cut
+
+sub secs_to_english{
+ my ($seconds) = @_;
+
+ my $days = int($seconds / 86400);
+ my $years = int($days / 365);
+ $days -= $years * 365;
+ my $result;
+ my @age;
+ push @age, "1 year" if ($years == 1);
+ push @age, "$years years" if ($years > 1);
+ push @age, "1 day" if ($days == 1);
+ push @age, "$days days" if ($days > 1);
+ $result .= join(" and ", @age);
+
+ return wantarray?($days,$result):$result;
+}
+
=head1 LOCK
die "One of bug or summary must be passed to read_bug"
if not exists $param{bug} and not exists $param{summary};
my $status;
+ my $log;
if (not defined $param{summary}) {
my ($lref, $location) = @param{qw(bug location)};
if (not defined $location) {
return undef if not defined $location;
}
$status = getbugcomponent($lref, 'summary', $location);
+ $log = getbugcomponent($lref, 'log' , $location);
return undef unless defined $status;
}
else {
$data{$field} = decode_rfc1522($data{$field});
}
}
+ # Add log last modified time
+ $data{log_modified} = (stat($log))[9];
return \%data;
}
use Debbugs::Config qw(:globals :text);
use Debbugs::User;
use Debbugs::CGI qw(version_url);
-use Debbugs::Common qw(getparsedaddrs);
+use Debbugs::Common qw(getparsedaddrs :date);
use Debbugs::Bugs qw(get_bugs);
use vars qw($gPackagePages $gWebDomain %gSeverityDisplay @gSeverityList);
split /[,\s]+/,$status{forwarded}
);
}
- my $daysold = int((time - $status{date}) / 86400); # seconds to days
- if ($daysold >= 7) {
+ # Check the age of the logfile
+ my ($days_last,$eng_last) = secs_to_english(time - $status{log_modified});
+ my ($days,$eng) = secs_to_english(time - $status{date});
+
+ if ($days >= 7) {
my $font = "";
my $efont = "";
- $font = "em" if ($daysold > 30);
- $font = "strong" if ($daysold > 60);
+ $font = "em" if ($days > 30);
+ $font = "strong" if ($days > 60);
$efont = "</$font>" if ($font);
$font = "<$font>" if ($font);
- my $yearsold = int($daysold / 365);
- $daysold -= $yearsold * 365;
-
- $result .= ";\n $font";
- my @age;
- push @age, "1 year" if ($yearsold == 1);
- push @age, "$yearsold years" if ($yearsold > 1);
- push @age, "1 day" if ($daysold == 1);
- push @age, "$daysold days" if ($daysold > 1);
- $result .= join(" and ", @age);
- $result .= " old$efont";
+ $result .= ";\n ${font}$eng old$efont";
}
+ if ($days_last > 7) {
+ my $font = "";
+ my $efont = "";
+ $font = "em" if ($days_last > 30);
+ $font = "strong" if ($days_last > 60);
+ $efont = "</$font>" if ($font);
+ $font = "<$font>" if ($font);
+
+ $result .= ";\n ${font}Modified $eng_last ago$efont";
+ }
}
$result .= ".";
- Split out packages so that you don't have to install the mail stuff
unless you want it.
- Only mail duplicated recipients once (closes: #172635)
+ - Indicate date of last activity (closes: #207065)
-- Colin Watson <cjwatson@debian.org> Fri, 20 Jun 2003 18:57:25 +0100