my $next_number = <$nn_fh>;
close $nn_fh;
chomp $next_number;
- return $next_number+0;
+ return $next_number-1;
}
=head2 bug_filter
my @packages = __handle_pkg_src_and_maint(map {exists $param{$_}?($_,$param{$_}):()}
qw(package src maint)
);
- my %usertag_bugs;
- if (exists $param{tag} and exists $param{usertags}) {
- # This complex slice makes a hash with the bugs which have the
- # usertags passed in $param{tag} set.
- @usertag_bugs{make_list(@{$param{usertags}}{make_list($param{tag})})
- } = (1) x make_list(@{$param{usertags}}{make_list($param{tag})});
- }
if (exists $param{package} or
exists $param{src} or
exists $param{maint}) {
delete @param{qw(maint src)};
$param{package} = [@packages];
}
- my $keys = keys(%param) - 1;
+ my $keys = grep {$_ !~ /^(archive|usertags|bugs)$/} keys(%param);
die "Need at least 1 key to search by" unless $keys;
my $arc = $param{archive} ? '-arc':'';
my %idx;
or die "Unable to open $index: $!";
my %bug_matching = ();
for my $search (make_list($param{$key})) {
- next unless defined $idx{$search};
- for my $bug (keys %{$idx{$search}}) {
+ for my $bug (keys %{$idx{$search}||{}}) {
next if $bug_matching{$bug};
# increment the number of searches that this bug matched
$bugs{$bug}++;
$bug_matching{$bug}=1;
}
+ if ($search ne lc($search)) {
+ for my $bug (keys %{$idx{lc($search)}||{}}) {
+ next if $bug_matching{$bug};
+ # increment the number of searches that this bug matched
+ $bugs{$bug}++;
+ $bug_matching{$bug}=1;
+ }
+ }
}
if ($key eq 'tag' and exists $param{usertags}) {
for my $bug (make_list(grep {defined $_ } @{$param{usertags}}{make_list($param{tag})})) {