* Add the name of the jobset to ReleaseSetJobs, otherwise we can't

distinguish between jobs with the same name in different jobsets
  (e.g. "trunk" vs "stdenv-branch" for Nixpkgs).
* Renamed the "attrName" field of Builds to "job".
* Renamed the "id" field of BuildSteps to "build".
This commit is contained in:
Eelco Dolstra
2009-03-12 14:18:30 +00:00
parent fec08462ee
commit a623ad157e
29 changed files with 96 additions and 88 deletions

View File

@ -58,7 +58,7 @@ sub doBuild {
{outPath => $dep}, {rows => 1, order_by => "stopTime DESC", type => 0, busy => 0});
if ($step && $step->status != 0) {
$buildStatus = 5;
$failedDepBuild = $step->id->id;
$failedDepBuild = $step->build->id;
$failedDepStepNr = $step->stepnr;
goto done;
}
@ -91,9 +91,8 @@ sub doBuild {
if (/^@\s+build-started\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)$/) {
$db->txn_do(sub {
$db->resultset('BuildSteps')->create(
{ id => $build->id
, stepnr => $buildStepNr++
$build->buildsteps->create(
{ stepnr => $buildStepNr++
, type => 0 # = build
, drvpath => $1
, outpath => $2
@ -107,8 +106,8 @@ sub doBuild {
elsif (/^@\s+build-succeeded\s+(\S+)\s+(\S+)$/) {
my $drvPath = $1;
$db->txn_do(sub {
(my $step) = $db->resultset('BuildSteps')->search(
{id => $build->id, type => 0, drvpath => $drvPath}, {});
(my $step) = $build->buildsteps->search(
{type => 0, drvpath => $drvPath}, {});
die unless $step;
$step->update({busy => 0, status => 0, stoptime => time});
});
@ -119,14 +118,13 @@ sub doBuild {
$someBuildFailed = 1;
$thisBuildFailed = 1 if $drvPath eq $drvPathStep;
$db->txn_do(sub {
(my $step) = $db->resultset('BuildSteps')->search(
{id => $build->id, type => 0, drvpath => $drvPathStep}, {});
(my $step) = $build->buildsteps->search(
{type => 0, drvpath => $drvPathStep}, {});
if ($step) {
$step->update({busy => 0, status => 1, errormsg => $4, stoptime => time});
} else {
$db->resultset('BuildSteps')->create(
{ id => $build->id
, stepnr => $buildStepNr++
$build->buildsteps->create(
{ stepnr => $buildStepNr++
, type => 0 # = build
, drvpath => $drvPathStep
, outpath => $2
@ -144,9 +142,8 @@ sub doBuild {
elsif (/^@\s+substituter-started\s+(\S+)\s+(\S+)$/) {
my $outPath = $1;
$db->txn_do(sub {
$db->resultset('BuildSteps')->create(
{ id => $build->id
, stepnr => $buildStepNr++
$build->buildsteps->create(
{ stepnr => $buildStepNr++
, type => 1 # = substitution
, outpath => $1
, busy => 1
@ -158,8 +155,8 @@ sub doBuild {
elsif (/^@\s+substituter-succeeded\s+(\S+)$/) {
my $outPath = $1;
$db->txn_do(sub {
(my $step) = $db->resultset('BuildSteps')->search(
{id => $build->id, type => 1, outpath => $outPath}, {});
(my $step) = $build->buildsteps->search(
{type => 1, outpath => $outPath}, {});
die unless $step;
$step->update({busy => 0, status => 0, stoptime => time});
});
@ -168,8 +165,8 @@ sub doBuild {
elsif (/^@\s+substituter-failed\s+(\S+)\s+(\S+)\s+(\S+)$/) {
my $outPath = $1;
$db->txn_do(sub {
(my $step) = $db->resultset('BuildSteps')->search(
{id => $build->id, type => 1, outpath => $outPath}, {});
(my $step) = $build->buildsteps->search(
{type => 1, outpath => $outPath}, {});
die unless $step;
$step->update({busy => 0, status => 1, errormsg => $3, stoptime => time});
});