);
my %bugs = ();
+ # If we're given an empty maint (unmaintained packages), we can't
+ # handle it, so bail out here
+ for my $maint (make_list(exists $param{maint}?$param{maint}:[])) {
+ if (defined $maint and $maint eq '') {
+ die "Can't handle empty maint (unmaintained packages) in get_bugs_by_idx";
+ }
+ }
+
# We handle src packages, maint and maintenc by mapping to the
# appropriate binary packages, then removing all packages which
# don't match all queries
# dist => {type => SCALAR|ARRAYREF,
# optional => 1,
# },
+ bugs => {type => SCALAR|ARRAYREF,
+ optional => 1,
+ },
archive => {type => BOOLEAN,
default => 1,
},
@usertag_bugs{make_list(@{$param{usertags}}{make_list($param{tag})})
} = (1) x make_list(@{$param{usertags}}{make_list($param{tag})});
}
+ my $unmaintained_packages = 0;
+ # unmaintained packages is a special case
+ for my $maint (make_list(exists $param{maint}?$param{maint}:[])) {
+ if (defined $maint and $maint eq '' and not $unmaintained_packages) {
+ $unmaintained_packages = 1;
+ our %maintainers = %{getmaintainers()};
+ $param{function} = [exists $param{function}?
+ (ref $param{function}?@{$param{function}}:$param{function}):(),
+ sub {my %d=@_;
+ foreach my $try (splitpackages($d{"pkg"})) {
+ return 1 if not exists $maintainers{$try};
+ }
+ return 0;
+ }
+ ];
+ }
+ }
# We handle src packages, maint and maintenc by mapping to the
# appropriate binary packages, then removing all packages which
# don't match all queries
exists $param{src} or
exists $param{maint}) {
delete @param{qw(maint src)};
- $param{package} = [@packages];
+ $param{package} = [@packages] if @packages;
}
my $grep_bugs = 0;
my %bugs;
$bugs{$_} = 1 for make_list($param{bugs});
$grep_bugs = 1;
}
- if (exists $param{owner} or exists $param{correspondent} or exists $param{affects}) {
- $bugs{$_} = 1 for get_bugs_by_idx(exists $param{correspondent}?(correspondent => $param{correspondent}):(),
- exists $param{owner}?(owner => $param{owner}):(),
- exists $param{affects}?(affects => $param{affects}):(),
+ # These queries have to be handled by get_bugs_by_idx
+ if (exists $param{owner}
+ or exists $param{correspondent}
+ or exists $param{affects}) {
+ $bugs{$_} = 1 for get_bugs_by_idx(map {exists $param{$_}?($_,$param{$_}):()}
+ qw(owner correspondent affects),
);
$grep_bugs = 1;
}
my @bugs;
- while (<$flatfile>) {
+ BUG: while (<$flatfile>) {
next unless m/^(\S+)\s+(\d+)\s+(\d+)\s+(\S+)\s+\[\s*([^]]*)\s*\]\s+(\w+)\s+(.*)$/;
my ($pkg,$bug,$time,$status,$submitter,$severity,$tags) = ($1,$2,$3,$4,$5,$6,$7);
next if $grep_bugs and not exists $bugs{$bug};
my @bug_tags = split ' ', $tags;
my @packages = splitpackages($pkg);
my $package = (@packages > 1)?\@packages:$packages[0];
- next unless
- $param{function}->(pkg => $package,
- bug => $bug,
- status => $status,
- submitter => $submitter,
- severity => $severity,
- tags => \@bug_tags,
- );
+ for my $function (make_list($param{function})) {
+ next BUG unless
+ $function->(pkg => $package,
+ bug => $bug,
+ status => $status,
+ submitter => $submitter,
+ severity => $severity,
+ tags => \@bug_tags,
+ );
+ }
}
push @bugs, $bug;
}
submitter => 'submitted by',
owner => 'owned by',
status => 'with status',
+ affects => 'which affect package',
correspondent => 'with mail from',
newest => 'newest bugs',
+ bugs => 'in bug',
);
our %package_search_keys = @package_search_key_order;
-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;
}
use Debbugs::Bugs qw(get_bugs bug_filter newest_bug);
use Debbugs::Packages qw(getsrcpkgs getpkgsrc get_versions);
+use Debbugs::Status qw(splitpackages);
+
use Debbugs::CGI qw(:all);
use Debbugs::CGI::Pkgreport qw(:all);
next unless exists $param{$incexc};
$param{$incexc} = [grep /\S\:\S/, make_list($param{$incexc})];
}
+ for my $key (keys %package_search_keys) {
+ next unless exists $param{key};
+ $param{$key} = [map {split /\s*,\s*/} make_list($param{$key})];
+ }
# kill off keys for which empty values are meaningless
- for my $key (qw(package src submitter severity status dist)) {
+ for my $key (qw(package src submitter affects severity status dist)) {
next unless exists $param{$key};
- $param{$key} = [grep {length $_} make_list($param{$key})];
+ $param{$key} = [grep {defined $_ and length $_}
+ make_list($param{$key})];
}
print $q->redirect(munge_url('pkgreport.cgi?',%param));
exit 0;
while (my ($key,$value) = splice @temp, 0, 2) {
next unless exists $param{$key};
my @entries = ();
- $param{$key} = [map {split /\s*,\s*/} make_list($param{$key})];
- for my $entry (grep {defined $_ and length $_ } make_list($param{$key})) {
+ for my $entry (make_list($param{$key})) {
+ # we'll handle newest below
+ next if $key eq 'newest';
my $extra = '';
if (exists $param{dist} and ($key eq 'package' or $key eq 'src')) {
my %versions = get_versions(package => $entry,
}
$extra= " ($verdesc)" if keys %versions;
}
- push @entries, $entry.$extra;
+ if ($key eq 'maint' and $entry eq '') {
+ push @entries, "no one (packages without maintainers)"
+ }
+ else {
+ push @entries, $entry.$extra;
+ }
}
push @title,$value.' '.join(' or ', @entries) if @entries;
}
-my $title = $gBugs.' '.join(' and ', map {/ or /?"($_)":$_} @title);
-@title = ();
-
-# we have to special case the maint="" search, unfortunatly.
-if (defined $param{maint} and $param{maint} eq "" or ref($param{maint}) and not @{$param{maint}}) {
- my %maintainers = %{getmaintainers()};
- @bugs = get_bugs(function =>
- sub {my %d=@_;
- foreach my $try (splitpackages($d{"pkg"})) {
- return 1 if not exists $maintainers{$try};
- }
- return 0;
- }
- );
- $title = $gBugs.' in packages with no maintainer';
-}
-elsif (defined $param{newest}) {
+if (defined $param{newest}) {
my $newest_bug = newest_bug();
@bugs = ($newest_bug - $param{newest} + 1) .. $newest_bug;
- $title = @bugs.' newest '.$gBugs;
-}
-else {
- #yeah for magick!
- @bugs = get_bugs((map {exists $param{$_}?($_,$param{$_}):()}
- keys %package_search_keys, 'archive'),
- usertags => \%ut,
- );
+ push @title, 'in '.@bugs.' newest reports';
+ $param{bugs} = [exists $param{bugs}?make_list($param{bugs}):(),
+ @bugs,
+ ];
}
+my $title = $gBugs.' '.join(' and ', map {/ or /?"($_)":$_} @title);
+@title = ();
+
+#yeah for magick!
+@bugs = get_bugs((map {exists $param{$_}?($_,$param{$_}):()}
+ grep {$_ ne 'newest'}
+ keys %package_search_keys, 'archive'),
+ usertags => \%ut,
+ );
+
if (defined $param{version}) {
$title .= " at version $param{version}";
}
use CGI::Simple;
-use CGI::Alert 'don@donarmstrong.com';
+# use CGI::Alert 'nobody@example.com';
use Search::Estraier;
use Debbugs::Config qw(:config);
extra status box (closes: #499990) Thanks to James Vega for the patch.
* Return 404 when a bug number that does not exist is used
(closes: #499997)
+ * Comment out CGI::Alert use for the time being (closes: #499681)
+ * No longer hard-code paths in age-1 (closes: #499682)
-- Colin Watson <cjwatson@debian.org> Fri, 20 Jun 2003 18:57:25 +0100
#!/bin/sh
# $Id: age-1.in,v 1.3 2002/01/06 10:46:24 ajt Exp $
set -e
-cd /var/lib/debbugs/spool/db-h
+cd "$(perl -MDebbugs::Config=:config -e 'print $config{spool_dir}')"
test -f ./-3.log && rm ./-3.log
test -f ./-2.log && mv ./-2.log ./-3.log
test -f ./-1.log && mv ./-1.log ./-2.log