From 91ecee0e5d6cf996ed47d557ba3a241c7d738d95 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 26 May 2015 15:54:38 +0200 Subject: [PATCH] Fix reproduce script --- src/lib/Hydra/Controller/Build.pm | 5 ++--- src/root/reproduce.tt | 4 +++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/lib/Hydra/Controller/Build.pm b/src/lib/Hydra/Controller/Build.pm index 8e4ea4e0..4080817a 100644 --- a/src/lib/Hydra/Controller/Build.pm +++ b/src/lib/Hydra/Controller/Build.pm @@ -99,9 +99,7 @@ sub build_GET { # Get the first eval of which this build was a part. ($c->stash->{nrEvals}) = $c->stash->{build}->jobsetevals->search({ hasnewbuilds => 1 })->count; - $c->stash->{eval} = $c->stash->{build}->jobsetevals->search( - { hasnewbuilds => 1}, - { rows => 1, order_by => ["id"] })->single; + $c->stash->{eval} = getFirstEval($build); $self->status_ok( $c, entity => $build @@ -554,6 +552,7 @@ sub reproduce : Chained('buildChain') PathPart('reproduce') Args(0) { $c->response->content_type('text/x-shellscript'); $c->response->header('Content-Disposition', 'attachment; filename="reproduce-build-' . $c->stash->{build}->id . '.sh"'); $c->stash->{template} = 'reproduce.tt'; + $c->stash->{eval} = getFirstEval($c->stash->{build}); } diff --git a/src/root/reproduce.tt b/src/root/reproduce.tt index 6846ee9f..f24d2fe6 100644 --- a/src/root/reproduce.tt +++ b/src/root/reproduce.tt @@ -79,7 +79,9 @@ requireCommand() { # Fetch the inputs. -[%+ FOREACH input IN build.inputs %] +[% inputs = build.inputs.size > 0 ? build.inputs : eval.jobsetevalinputs %] + +[%+ FOREACH input IN inputs %] inputDir= [%+ IF input.type == "git" %]