Skip to content

Commit

Permalink
[backend] Deal with packid=undef in the buildjob generation
Browse files Browse the repository at this point in the history
This can happen for buildinfo requests from the repo server.
  • Loading branch information
mlschroe committed Jul 8, 2016
1 parent 48d2f39 commit 0a3a94e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/backend/BSSched/BuildJob.pm
Expand Up @@ -823,7 +823,7 @@ sub create {
my $proj = $projpacks->{$projid};
my $prp = "$projid/$repoid";
my $srcmd5 = $pdata->{'srcmd5'};
my $job = jobname($prp, $packid);
my $job = $packid ? jobname($prp, $packid) : undef;
my @otherjobs;
my $myjobsdir = $gctx->{'myjobsdir'};
my $isreposerver = $ctx->{'isreposerver'};
Expand All @@ -835,7 +835,7 @@ sub create {
return ('scheduled', $job) if -s "$myjobsdir/$job"; # obsolete
@otherjobs = grep {/^\Q$job\E-[0-9a-f]{32}$/} ls($myjobsdir);
}
$job = "$job-$srcmd5" if $srcmd5;
$job = "$job-$srcmd5" if defined($job) && $srcmd5;

# a new one. expand usedforbuild. write info file.
my $buildtype = $pdata->{'buildtype'} || Build::recipe2buildtype($info->{'file'});
Expand Down
4 changes: 2 additions & 2 deletions src/backend/BSSched/BuildJob/Package.pm
Expand Up @@ -326,8 +326,8 @@ sub build {
$needed->{$_}++ for map { $dep2src->{$_} || $_ } @{$edeps->{$p}};
}
}
$info->{'nounchanged'} = 1 if $ctx->{'cychash'}->{$packid};
my ($state, $job) = BSSched::BuildJob::create($ctx, $packid, $pdata, $info, $ctx->{'subpacks'}->{$info->{'name'}} || [], $info->{'edeps'} || $ctx->{'edeps'}->{$packid} || [], $reason, $needed->{$packid} || 0);
$info->{'nounchanged'} = 1 if $packid && $ctx->{'cychash'}->{$packid};
my ($state, $job) = BSSched::BuildJob::create($ctx, $packid, $pdata, $info, $ctx->{'subpacks'}->{$info->{'name'}} || [], $info->{'edeps'} || $ctx->{'edeps'}->{$packid} || [], $reason, $packid ? ($needed->{$packid} || 0) : 0);
delete $info->{'nounchanged'};
return ($state, $job);
}
Expand Down

0 comments on commit 0a3a94e

Please sign in to comment.