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 %= 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?(int($seconds/86400),$result):$result;
+}
+
=head1 LOCK
#use Params::Validate;
use Search::Estraier;
use Date::Manip;
-use Debbugs::Common qw(getbuglocation getbugcomponent);
+use Debbugs::Common qw(getbuglocation getbugcomponent make_list);
use Debbugs::Status qw(readbug);
use Debbugs::MIME qw(parse);
$doc = new Search::Estraier::Document if not defined $doc;
my $message = parse($bug_message);
- $doc->add_text(join('',values %{$message}));
+ $doc->add_text(join('',make_list(values %{$message})));
# * @id : the ID number determined automatically when the document is registered.
# * @uri : the location of a document which any document should have.
my @attr = qw(status subject date submitter package tags severity);
# parse the date
my ($date) = $bug_message =~ /^Date:\s+(.+?)\s*$/mi;
- $doc->add_attr('@cdate' => $date);
+ $doc->add_attr('@cdate' => $date) if defined $date;
# parse the title
my ($subject) = $bug_message =~ /^Subject:\s+(.+?)\s*$/mi;
- $doc->add_attr('@title' => $subject);
+ $doc->add_attr('@title' => $subject) if defined $subject;
# parse the author
my ($author) = $bug_message =~ /^From:\s+(.+?)\s*$/mi;
- $doc->add_attr('@author' => $author);
+ $doc->add_attr('@author' => $author) if defined $author;
# create the uri
$doc->add_attr('@uri' => $uri);
foreach my $attr (@attr) {
- $doc->add_attr($attr => $status->{$attr});
+ $doc->add_attr($attr => $status->{$attr}) if defined $status->{$attr};
}
print STDERR "adding $uri\n" if $DEBUG;
# Try a bit harder if estraier is returning timeouts
my @recipients;
@recipients = @{$param{recipients}} if defined $param{recipients} and
ref($param{recipients}) eq 'ARRAY';
+ my %recipients;
+ @recipients{@recipients} = (1) x @recipients;
+ @recipients = keys %recipients;
# If there are no recipients, use -t to parse the message
if (@recipients == 0) {
$param{parse_for_recipients} = 1 unless exists $param{parse_for_recipients};
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 .= ".";
- Fix double leading spaces of format=flowed messages
(closes: #428056)
- Don't doubly select users
- - Implement versioning aware archiving support (closes: #419693)
+ - Implement versioning aware archiving support (closes: #339141)
- 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)
+ - Reorder title (closes: #265267)
-- Colin Watson <cjwatson@debian.org> Fri, 20 Jun 2003 18:57:25 +0100