Skip to content

Commit

Permalink
[backend] use $pool->allpackages() method if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
mlschroe committed Jul 29, 2015
1 parent 223591d commit 7c5784a
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/backend/bs_repserver
Expand Up @@ -3118,15 +3118,19 @@ sub getbuildinfo {
my %sysdeps = map {$_ => 1} @sysdeps;

if ($pdata->{'buildenv'}) {
# crude way to get ids of all packages
my $npkgs = 0;
for my $r ($pool->repos()) {
my @pids = $r->getpathid();
$npkgs += @pids / 2;
my @allpackages;
if (defined &BSSolv::pool::allpackages) {
@allpackages = $pool->allpackages();
} else {
# crude way to get ids of all packages
my $npkgs = 0;
for my $r ($pool->repos()) {
my @pids = $r->getpathid();
$npkgs += @pids / 2;
}
@allpackages = 2 ... ($npkgs + 1) if $npkgs;
}
my %allpackages;
my @allpackages;
@allpackages = 2 ... ($npkgs + 1) if $npkgs;
for my $p (@allpackages) {
my $n = $pool->pkg2name($p);
my $hdrmd5 = $pool->pkg2pkgid($p);
Expand Down

0 comments on commit 7c5784a

Please sign in to comment.