forked from lix-project/hydra
Warn against multiple jobs with the same name
This commit is contained in:
parent
da5824e11c
commit
a8db329839
|
@ -282,7 +282,16 @@ sub evalJobs {
|
||||||
SuppressEmpty => '')
|
SuppressEmpty => '')
|
||||||
or die "cannot parse XML output";
|
or die "cannot parse XML output";
|
||||||
|
|
||||||
return ($jobs, $nixExprInput);
|
my %jobNames;
|
||||||
|
my $errors;
|
||||||
|
foreach my $job (@{$jobs->{job}}) {
|
||||||
|
$jobNames{$job->{jobName}}++;
|
||||||
|
if ($jobNames{$job->{jobName}} == 2) {
|
||||||
|
$errors .= "warning: there are multiple jobs named ‘$job->{jobName}’; support for this will go away soon!\n\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ($jobs, $nixExprInput, $errors);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -133,7 +133,7 @@ sub checkJobsetWrapped {
|
||||||
|
|
||||||
# Evaluate the job expression.
|
# Evaluate the job expression.
|
||||||
my $evalStart = time;
|
my $evalStart = time;
|
||||||
my ($jobs, $nixExprInput) = evalJobs($inputInfo, $exprType, $jobset->nixexprinput, $jobset->nixexprpath);
|
my ($jobs, $nixExprInput, $msg) = evalJobs($inputInfo, $exprType, $jobset->nixexprinput, $jobset->nixexprpath);
|
||||||
my $evalStop = time;
|
my $evalStop = time;
|
||||||
|
|
||||||
my $jobOutPathMap = {};
|
my $jobOutPathMap = {};
|
||||||
|
@ -238,7 +238,6 @@ sub checkJobsetWrapped {
|
||||||
});
|
});
|
||||||
|
|
||||||
# Store the error messages for jobs that failed to evaluate.
|
# Store the error messages for jobs that failed to evaluate.
|
||||||
my $msg = "";
|
|
||||||
foreach my $error (@{$jobs->{error}}) {
|
foreach my $error (@{$jobs->{error}}) {
|
||||||
my $bindings = "";
|
my $bindings = "";
|
||||||
foreach my $arg (@{$error->{arg}}) {
|
foreach my $arg (@{$error->{arg}}) {
|
||||||
|
|
Loading…
Reference in a new issue