}
-=head HTML
+=head1 HTML
=head2 htmlize_packagelinks
terse => $param{terse},
exists $param{msg}?(msg=>$param{msg}):(),
exists $param{att}?(att=>$param{att}):(),
+ exists $param{trim_headers}?(trim_headers=>$param{trim_headers}):(),
);
return $output;
@EXPORT = ();
%EXPORT_TAGS = (util => [qw(getbugcomponent getbuglocation getlocationpath get_hashname),
qw(appendfile buglog getparsedaddrs getmaintainers),
+ qw(bug_status),
qw(getmaintainers_reverse),
qw(getpseudodesc),
],
return undef;
}
+=head2 bug_status
+
+ bug_status($bugnum)
+
+
+Returns the path to the summary file corresponding to the bug.
+
+Returns undef if the bug does not exist.
+
+=cut
+
+sub bug_status{
+ my ($bugnum) = @_;
+ my $location = getbuglocation($bugnum, 'summary');
+ return getbugcomponent($bugnum, 'summary', $location) if ($location);
+ return undef;
+}
=head2 appendfile
sub english_join {
if (ref $_[0] eq 'ARRAY') {
- english_join(list=>$_[0]);
+ return english_join(list=>$_[0]);
}
- my %param = validate_with(param => \@_,
+ my %param = validate_with(params => \@_,
spec => {normal => {type => SCALAR,
default => ', ',
},
Default: $config{maintainer_email}
-=back
-
=cut
set_default(\%config,'unknown_maintainer_email',$config{maintainer_email});
Takes a filehandle and a list of records as input, and prints the .log
format representation of those records to that filehandle.
+=back
+
=cut
sub write_log_records (*@)
}
-=back
-
=head1 CAVEATS
This module does none of the formatting that bugreport.cgi et al do. It's
=head1 METHODS
-=over 8
-
-=item getpkgsrc
+=head2 getpkgsrc
Returns a reference to a hash of binary package names to their corresponding
source package names.
return $_pkgsrc;
}
-=item getpkgcomponent
+=head2 getpkgcomponent
Returns a reference to a hash of binary package names to the component of
the archive containing those binary packages (e.g. "main", "contrib",
return $_pkgcomponent;
}
-=item getsrcpkgs
+=head2 getsrcpkgs
Returns a list of the binary packages produced by a given source package.
return @{$_srcpkg->{$src}};
}
-=item binarytosource
+=head2 binarytosource
Returns a reference to the source package name and version pair
corresponding to a given binary package name, version, and architecture.
return ();
}
-=item sourcetobinary
+=head2 sourcetobinary
Returns a list of references to triplets of binary package names, versions,
and architectures corresponding to a given source package name and version.
return map [$_, $srcver], @srcpkgs;
}
-=item getversions
+=head2 getversions
Returns versions of the package in a distribution at a specific
architecture
}
-=item makesourceversions
+=head2 makesourceversions
@{$cgi_var{found}} = makesourceversions($cgi_var{package},undef,@{$cgi_var{found}});
-=back
-
-=cut
-
1;
qw(removefoundversions removefixedversions)
],
hook => [qw(bughook bughook_archive)],
+ fields => [qw(%fields)],
);
@EXPORT_OK = ();
- Exporter::export_ok_tags(qw(status read write versions hook));
+ Exporter::export_ok_tags(qw(status read write versions hook fields));
$EXPORT_TAGS{all} = [@EXPORT_OK];
}
=cut
-
-my %fields = (originator => 'submitter',
+# these probably shouldn't be imported by most people, but
+# Debbugs::Control needs them, so they're now exportable
+our %fields = (originator => 'submitter',
date => 'date',
subject => 'subject',
msgid => 'message-id',
$data{$field} = decode_rfc1522($data{$field});
}
}
+ my $status_modified = (stat($status))[9];
# Add log last modified time
$data{log_modified} = (stat($log))[9];
+ $data{last_modified} = max($status_modified,$data{log_modified});
$data{location} = $location;
$data{archived} = (defined($location) and ($location eq 'archive'))?1:0;
$data{bug_num} = $param{bug};
install_exec := install -m755 -p
install_data := install -m644 -p
-test:
- perl -MTest::Harness -I. -e 'runtests(glob(q(t/*.t)))'
+PERL ?= /usr/bin/perl
+
+all: build test
+
+build:
+ $(PERL) Makefile.PL
+ $(MAKE) -f Makefile.perl
+
+test: build
+ $(PERL) -MTest::Harness -I. -e 'runtests(glob(q(t/*.t)))'
+
+clean:
+ if [ -e Makefile.perl ]; then \
+ $(MAKE) -f Makefile.perl clean; \
+ fi;
install: install_mostfiles
# install basic debbugs documentation
$(foreach tmpl, $(wildcard templates/*/*/*.tmpl), $(exec $(install_data) $(tmpl) $(template_dir)/$(patsubst templates/%,%,$(tmpl))))
-.PHONY: test
\ No newline at end of file
+.PHONY: test build
\ No newline at end of file
use Debbugs::Log qw(read_log_records);
use Debbugs::CGI qw(:url :html :util);
use Debbugs::CGI::Bugreport qw(:all);
-use Debbugs::Common qw(buglog getmaintainers make_list);
+use Debbugs::Common qw(buglog getmaintainers make_list bug_status);
use Debbugs::Packages qw(getpkgsrc);
use Debbugs::Status qw(splitpackages get_bug_status isstrongseverity);
use Debbugs::Text qw(:templates);
+use List::Util qw(max);
+
use CGI::Simple;
my $q = new CGI::Simple;
my %ut;
my %seen_users;
+my $buglog = buglog($ref);
+my $bug_status = bug_status($ref);
+if (not defined $buglog or not defined $bug_status) {
+ print $q->header(-status => "404 No such bug",
+ -type => "text/html",
+ -charset => 'utf-8',
+ );
+ print fill_in_template(template=>'cgi/no_such_bug',
+ variables => {modify_time => strftime('%a, %e %b %Y %T UTC', gmtime),
+ bug_num => $ref,
+ },
+ );
+ exit 0;
+}
+
+# the log should almost always be newer, but just in case
+my $log_mtime = +(stat $buglog)[9] || time;
+my $status_mtime = +(stat $bug_status)[9] || time;
+my $mtime = strftime '%a, %d %b %Y %T GMT', gmtime(max($status_mtime,$log_mtime));
+
+if ($q->request_method() eq 'HEAD' and not defined($att) and not $mbox) {
+ print $q->header(-type => "text/html",
+ -charset => 'utf-8',
+ (length $mtime)?(-last_modified => $mtime):(),
+ );
+ exit 0;
+}
+
for my $user (map {split /[\s*,\s*]+/} make_list($param{users}||[])) {
next unless length($user);
add_user($user,\%ut,\%bugusertags,\%seen_users);
my $archive = $param{'archive'} eq 'yes';
my $repeatmerged = $param{'repeatmerged'} eq 'yes';
-my $buglog = buglog($ref);
-if (not defined $buglog) {
- print $q->header(-status => "404 No such bug",
- -type => "text/html",
- -charset => 'utf-8',
- );
- print fill_in_template(template=>'cgi/no_such_bug',
- variables => {modify_time => strftime('%a, %e %b %Y %T UTC', gmtime),
- bug_num => $ref,
- },
- );
- exit 0;
-}
-
-my @stat = stat $buglog;
-my $mtime = '';
-if (@stat) {
- $mtime = strftime '%a, %d %b %Y %T GMT', gmtime($stat[9]);
-}
-
-if ($q->request_method() eq 'HEAD' and not defined($att) and not $mbox) {
- print $q->header(-type => "text/html",
- -charset => 'utf-8',
- (length $mtime)?(-last_modified => $mtime):(),
- );
- exit 0;
-}
my $buglogfh;
msg_num => $msg_num,
att => $att,
msg => $msg,
+ trim_headers => $trim_headers,
);
exit 0;
}
* Add Date headers if missing (closes: #458757)
* Indicate what machine has built webpages (closes: #507022)
* Indicate the update location of source (closes: #512306)
+ * Use get_addresses to parse X-Debbugs-Cc: to allow multiple Cc:'s
+ (closes: #514183)
+ * Calculate last modified using summary as well as log (closes: #515063)
+ * Ditch 'as before' (closes: #514677)
+ * Don't have reply/subscribe links for archived bugs (closes: #511864)
-- Colin Watson <cjwatson@debian.org> Fri, 20 Jun 2003 18:57:25 +0100
liburi-perl, libsoap-lite-perl, libcgi-simple-perl,
libhttp-server-simple-perl, libtest-www-mechanize-perl,
libmail-rfc822-address-perl, libsafe-hole-perl, libuser-perl,
- libconfig-simple-perl
+ libconfig-simple-perl, libtest-pod-perl
Package: debbugs
Architecture: all
use MIME::Parser;
use Debbugs::MIME qw(decode_rfc1522 create_mime_message getmailbody);
-use Debbugs::Mail qw(send_mail_message encode_headers);
+use Debbugs::Mail qw(send_mail_message encode_headers get_addresses);
use Debbugs::Packages qw(getpkgsrc);
use Debbugs::User qw(read_usertags write_usertags);
use Debbugs::Common qw(:lock get_hashname);
my $xcchdr= $header{ 'x-debbugs-cc' } || '';
if ($xcchdr =~ m/\S/) {
- push(@resentccs,$xcchdr);
+ push(@resentccs,get_addresses($xcchdr));
$resentccexplain.= fill_template('mail/xdebbugscc',
{xcchdr => $xcchdr},
);
--- /dev/null
+# -*- mode: cperl; -*-
+use Test::More;
+eval "use Test::Pod 1.00";
+plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
+all_pod_files_ok();
status_key => 'severity',
status_value => 'wishlist',
},
- reassign_bar => {command => 'reassign',
- value => 'bar',
- status_key => 'package',
- status_value => 'bar',
- },
+ reassign_bar_baz => {command => 'reassign',
+ value => 'bar,baz',
+ status_key => 'package',
+ status_value => 'bar,baz',
+ },
reassign_foo => {command => 'reassign',
value => 'foo',
status_key => 'package',
$output .= sprintf qq(<p><a href="%s">Full log</a></p>),html_escape(bug_links(bug=>$bug_num,links_only=>1));
}
else {
- $output .= qq(<p><a href="mailto:$bug_num\@$config{email_domain}">Reply</a> ).
- qq(or <a href="mailto:$bug_num-subscribe\@$config{email_domain}">subscribe</a> ).
+ if (not $status{archived}) {
+ $output .= qq(<p><a href="mailto:$bug_num\@$config{email_domain}">Reply</a> ).
+ qq(or <a href="mailto:$bug_num-subscribe\@$config{email_domain}">subscribe</a> ).
qq(to this bug.</p>\n);
+ }
$output .= qq(<p><a href="javascript:toggle_infmessages();">Toggle useless messages</a></p>);
$output .= sprintf qq(<div class="msgreceived"><p>View this report as an <a href="%s">mbox folder</a>, ).
qq(<a href="%s">status mbox</a>, <a href="%s">maintainer mbox</a></p></div>\n),
has been received.
{ $forwardexplain }{ $resentccexplain }
If you wish to submit further information on this problem, please
-send it to { $refreplyto }, as before.
+send it to { $refreplyto }.
Please do not send mail to {$config{maintainer_email}} unless you wish
to report a problem with the {ucfirst($config{bug})}-tracking system.