BuildDiff: move cmdBuilds from Controller/JobsetEval

This commit is contained in:
Cole Helbling 2022-01-10 10:35:07 -08:00
parent 0c51f3ca7d
commit ec98bdaaaa
2 changed files with 9 additions and 9 deletions

View file

@ -64,18 +64,9 @@ sub view_GET {
$c->stash->{otherEval} = $eval2 if defined $eval2;
sub cmpBuilds {
my ($left, $right) = @_;
return $left->get_column('job') cmp $right->get_column('job')
|| $left->get_column('system') cmp $right->get_column('system')
}
my @builds = $eval->builds->search($filter, { columns => [@buildListColumns] });
my @builds2 = defined $eval2 ? $eval2->builds->search($filter, { columns => [@buildListColumns] }) : ();
@builds = sort { cmpBuilds($a, $b) } @builds;
@builds2 = sort { cmpBuilds($a, $b) } @builds2;
buildDiff(@builds, @builds2);
$c->stash->{full} = ($c->req->params->{full} || "0") eq "1";

View file

@ -15,6 +15,15 @@ our @EXPORT = qw(
use Data::Dumper;
sub cmpBuilds {
my ($left, $right) = @_;
return $left->get_column('job') cmp $right->get_column('job')
|| $left->get_column('system') cmp $right->get_column('system')
}
# $builds = sort { cmpBuilds($a, $b) } $builds;
# $builds2 = sort { cmpBuilds($a, $b) } $builds2;
sub buildDiff {
my ($builds, $builds2) = @_;