Skip to content

Commit

Permalink
[backend] fixes after rebase BSRepServer::BuildInfo::Generic testing
Browse files Browse the repository at this point in the history
  • Loading branch information
M0ses committed Jun 16, 2016
1 parent 8957881 commit 73ee4f9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions src/backend/BSRepServer/BuildInfo.pm
Expand Up @@ -104,7 +104,8 @@ sub getbuildenv {
}

sub getpreinstallimages {
my ($prpa) = @_;
my ($self, $prpa) = @_;
my $reporoot = $self->{gctx}->{reporoot};
return undef unless -e "$reporoot/$prpa/:preinstallimages";
if (-l "$reporoot/$prpa/:preinstallimages") {
# small hack: allow symlink to another prpa's file
Expand Down Expand Up @@ -828,18 +829,18 @@ sub getbuildinfo {
$b->{'noinstall'} = 1 if $bdeps{$_} && !($sysdeps{$_} || $vmdeps{$_} || $pdeps{$_});
}
push @rdeps, $b;
push @preimghdrs, $pool->pkg2pkgid($p) if !$b->{'noinstall'};
push @preimghdrs, $self->{pool}->pkg2pkgid($p) if !$b->{'noinstall'};
}

if (!$cgi->{'internal'}) {
if (!$self->{'internal'}) {
my %neededhdrmd5s = map {$_ => 1} grep {$_} @preimghdrs;
my @prpas = map {$_->name() . "/$arch"} $pool->repos();
my @prpas = map {$_->name() . "/$arch"} $self->{pool}->repos();

my $bestimgn = 2;
my $bestimg;

for my $prpa (@prpas) {
my $images = getpreinstallimages($prpa);
my $images = $self->getpreinstallimages($prpa);
next unless $images;
for my $img (@$images) {
next if @{$img->{'hdrmd5s'} || []} < $bestimgn;
Expand Down
2 changes: 1 addition & 1 deletion src/backend/t/0310-BSRepServer-BuildInfo-Generic.t
Expand Up @@ -38,7 +38,7 @@ use warnings;

use_ok("BSRepServer::BuildInfo");

my ($bi) = BSRepServer::BuildInfo::getbuildinfo({}, 'openSUSE:13.2', 'standard', 'i586', 'screen');
my ($bi) = BSRepServer::BuildInfo->new(projid=>'openSUSE:13.2', repoid=>'standard', arch=>'i586', packid=>'screen')->getbuildinfo();
my $xbi = BSUtil::readxml("testdata/buildinfo/result/buildinfo_13_2_screen", $BSXML::buildinfo);

$bi->{'bdep'} = [ sort {$a->{'name'} cmp $b->{'name'}} @{$bi->{'bdep'} || []} ];
Expand Down

0 comments on commit 73ee4f9

Please sign in to comment.