This commit is contained in:
Eelco Dolstra
2012-04-03 11:28:59 +02:00
parent db2b2b6134
commit 30e2b9046a
3 changed files with 15 additions and 11 deletions

View File

@ -12,6 +12,7 @@ our @EXPORT = qw(
error notFound
requireLogin requireProjectOwner requireAdmin requirePost isAdmin isProjectOwner
trim
getLatestFinishedEval
$pathCompRE $relPathRE $relNameRE $jobNameRE $systemRE
@buildListColumns
);
@ -168,6 +169,17 @@ sub trim {
}
sub getLatestFinishedEval {
my ($c, $jobset) = @_;
my ($eval) = $jobset->jobsetevals->search(
{ hasnewbuilds => 1 },
{ order_by => "id DESC", rows => 1
, where => \ "not exists (select 1 from JobsetEvalMembers m join Builds b on m.build = b.id where m.eval = me.id and b.finished = 0)"
});
return $eval;
}
# Security checking of filenames.
Readonly our $pathCompRE => "(?:[A-Za-z0-9-\+\._][A-Za-z0-9-\+\._]*)";
Readonly our $relPathRE => "(?:$pathCompRE(?:/$pathCompRE)*)";