Skip to content

Commit

Permalink
[backend] BSSched::Checker: allow myjobsdir to be undef
Browse files Browse the repository at this point in the history
Used in the testcases
  • Loading branch information
mlschroe committed Jun 17, 2016
1 parent 985635f commit 0e92f17
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
13 changes: 8 additions & 5 deletions src/backend/BSSched/BuildJob.pm
Expand Up @@ -763,13 +763,16 @@ sub create {
my $prp = "$projid/$repoid";
my $srcmd5 = $pdata->{'srcmd5'};
my $job = jobname($prp, $packid);
my @otherjobs;
my $myjobsdir = $gctx->{'myjobsdir'};
if (-s "$myjobsdir/$job-$srcmd5") {
add_crossmarker($gctx, $bconf->{'hostarch'}, "$job-$srcmd5") if $bconf->{'hostarch'}; # just in case...
return ('scheduled', "$job-$srcmd5");
if ($myjobsdir) {
if (-s "$myjobsdir/$job-$srcmd5") {
add_crossmarker($gctx, $bconf->{'hostarch'}, "$job-$srcmd5") if $bconf->{'hostarch'}; # just in case...
return ('scheduled', "$job-$srcmd5");
}
return ('scheduled', $job) if -s "$myjobsdir/$job"; # obsolete
@otherjobs = grep {/^\Q$job\E-[0-9a-f]{32}$/} ls($myjobsdir);
}
return ('scheduled', $job) if -s "$myjobsdir/$job"; # obsolete
my @otherjobs = grep {/^\Q$job\E-[0-9a-f]{32}$/} ls($myjobsdir);
$job = "$job-$srcmd5";

# a new one. expand usedforbuild. write info file.
Expand Down
2 changes: 1 addition & 1 deletion src/backend/BSSched/Checker.pm
Expand Up @@ -751,7 +751,7 @@ sub checkpkgs {
# hmm, this might be a bad idea...
my $job = BSSched::BuildJob::jobname($prp, $packid)."-$pdata->{'srcmd5'}";
my $myjobsdir = $gctx->{'myjobsdir'};
if (-s "$myjobsdir/$job") {
if ($myjobsdir && -s "$myjobsdir/$job") {
# print " - $packid ($buildtype)\n";
# print " already scheduled\n";
my $bconf = $ctx->{'conf'};
Expand Down
1 change: 0 additions & 1 deletion src/backend/t/0170-BSSched-BuildJob-Package.t
Expand Up @@ -22,7 +22,6 @@ my $gctx = {
'arch' => 'i586',
'reporoot' => "$BSConfig::bsdir/build",
'obsname' => 'testobs',
'myjobsdir' => 'testdata/jobsdir_does_not_exist',
};

my $projpacksin = readxml('testdata/buildinfo/srcserver/getprojpack?withsrcmd5&withdeps&withrepos&withconfig&withremotemap&ignoredisable&project=openSUSE:13.2&repository=standard&arch=i586&package=screen', $BSXML::projpack);
Expand Down

0 comments on commit 0e92f17

Please sign in to comment.