Browse files

[backend] fix repoinfo_ext query, use a whitelist instead of a blacklist

  • Loading branch information...
1 parent 325a746 commit 56c89a6d1f3f16fc77842b7c9dc5084bca6ac115 @mlschroe mlschroe committed with adrianschroeter Nov 8, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/backend/bs_repserver
View
5 src/backend/bs_repserver
@@ -833,12 +833,13 @@ sub getbinary_info {
die("repository $prp not available\n") unless $r;
}
$pool->createwhatprovides();
+ my %keep = map {$_ => 1} qw{name epoch version release arch};
for my $prov (@{$res->{'provides'}}) {
my $n = {'dep' => $prov};
push @{$res->{'provides_ext'}}, $n;
for my $p ($pool->whatrequires($prov)) {
my $rd = $pool->pkg2data($p);
- delete $rd->{$_} for qw{provides requires source path hdrmd5 id};
+ delete $rd->{$_} for grep {!$keep{$_}} keys %$rd;
($rd->{'project'}, $rd->{'repository'}) = split('/', $pool->pkg2reponame($p), 2);
push @{$n->{'requiredby'}}, $rd;
}
@@ -848,7 +849,7 @@ sub getbinary_info {
push @{$res->{'requires_ext'}}, $n;
for my $p ($pool->whatprovides($req)) {
my $rd = $pool->pkg2data($p);
- delete $rd->{$_} for qw{provides requires source path hdrmd5 id};
+ delete $rd->{$_} for grep {!$keep{$_}} keys %$rd;
($rd->{'project'}, $rd->{'repository'}) = split('/', $pool->pkg2reponame($p), 2);
push @{$n->{'providedby'}}, $rd;
}

0 comments on commit 56c89a6

Please sign in to comment.