From c2c2633e501869139c5d8401814f0f9d736d2e1b Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Tue, 11 Apr 2017 14:25:48 +0200 Subject: [PATCH] Fix link to cached build log Fixes #462. --- src/lib/Hydra/Controller/Build.pm | 5 ++++- src/root/build.tt | 9 +++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/lib/Hydra/Controller/Build.pm b/src/lib/Hydra/Controller/Build.pm index d688ea0d..047d0d8e 100644 --- a/src/lib/Hydra/Controller/Build.pm +++ b/src/lib/Hydra/Controller/Build.pm @@ -73,7 +73,10 @@ sub build_GET { if ($build->finished && $build->iscachedbuild) { my $path = ($build->buildoutputs)[0]->path or die; my $cachedBuildStep = findBuildStepByOutPath($self, $c, $path); - $c->stash->{cachedBuild} = $cachedBuildStep->build if defined $cachedBuildStep; + if (defined $cachedBuildStep) { + $c->stash->{cachedBuild} = $cachedBuildStep->build; + $c->stash->{cachedBuildStep} = $cachedBuildStep; + } } if ($build->finished) { diff --git a/src/root/build.tt b/src/root/build.tt index 5284907c..d79283c1 100644 --- a/src/root/build.tt +++ b/src/root/build.tt @@ -137,7 +137,7 @@ END; [% IF isAggregate %]
  • Constituents
  • [% END %]
  • Details
  • Inputs
  • - [% IF steps %]
  • Build steps
  • [% END %] + [% IF steps.size() > 0 %]
  • Build steps
  • [% END %] [% IF build.dependents %]
  • Used by
  • [% END%] [% IF drvAvailable %]
  • Build dependencies
  • [% END %] [% IF available %]
  • Runtime dependencies
  • [% END %] @@ -230,9 +230,10 @@ END; Logfile: - pretty - raw - tail + [% actualLog = cachedBuildStep ? c.uri_for('/build' cachedBuild.id 'nixlog' cachedBuildStep.stepnr) : c.uri_for('/build' build.id 'log') %] + pretty + raw + tail [% END %]