From 2b790ceefa4d3b92acbee745b1ce8deaba1291a3 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 27 Oct 2016 14:43:17 +0200 Subject: [PATCH] Remove the pretty-printed log It didn't work anymore due to the removal of nix-log2xml. And in any case XSL is the work of the devil. --- configure.ac | 1 - release.nix | 2 +- src/Makefile.am | 2 +- src/lib/Hydra/Controller/Build.pm | 7 +-- src/root/log.tt | 8 ++- src/root/plain-reload.tt | 4 +- src/root/static/css/hydra.css | 4 +- src/root/static/css/logfile.css | 50 ------------------- src/xsl/Makefile.am | 4 -- src/xsl/log2html.xsl | 81 ------------------------------- src/xsl/mark-errors.xsl | 29 ----------- 11 files changed, 9 insertions(+), 183 deletions(-) delete mode 100644 src/root/static/css/logfile.css delete mode 100644 src/xsl/Makefile.am delete mode 100644 src/xsl/log2html.xsl delete mode 100644 src/xsl/mark-errors.xsl diff --git a/configure.ac b/configure.ac index d2bb416a..10c8509b 100644 --- a/configure.ac +++ b/configure.ac @@ -74,7 +74,6 @@ AC_CONFIG_FILES([ src/hydra-eval-jobs/Makefile src/hydra-queue-runner/Makefile src/sql/Makefile - src/xsl/Makefile src/ttf/Makefile src/lib/Makefile src/root/Makefile diff --git a/release.nix b/release.nix index 0587e53a..d77d642c 100644 --- a/release.nix +++ b/release.nix @@ -135,7 +135,7 @@ rec { ]; hydraPath = lib.makeBinPath ( - [ libxslt sqlite subversion openssh nix coreutils findutils pixz + [ sqlite subversion openssh nix coreutils findutils pixz gzip bzip2 lzma gnutar unzip git gitAndTools.topGit mercurial darcs gnused bazaar ] ++ lib.optionals stdenv.isLinux [ rpm dpkg cdrkit ] ); diff --git a/src/Makefile.am b/src/Makefile.am index c760eda1..a28780b6 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,3 +1,3 @@ -SUBDIRS = hydra-evaluator hydra-eval-jobs hydra-queue-runner sql script lib root xsl ttf +SUBDIRS = hydra-evaluator hydra-eval-jobs hydra-queue-runner sql script lib root ttf BOOTCLEAN_SUBDIRS = $(SUBDIRS) DIST_SUBDIRS = $(SUBDIRS) diff --git a/src/lib/Hydra/Controller/Build.pm b/src/lib/Hydra/Controller/Build.pm index 2571d11b..67707bfe 100644 --- a/src/lib/Hydra/Controller/Build.pm +++ b/src/lib/Hydra/Controller/Build.pm @@ -155,19 +155,14 @@ sub showLog { || $size < 64 * 1024 * 1024; if ($mode eq "pretty") { - # !!! quick hack - my $pipeline = ($logPath =~ /.bz2$/ ? "bzip2 -d < $logPath" : "cat $logPath") - . " | nix-log2xml | xsltproc " . $c->path_to("xsl/mark-errors.xsl") . " -" - . " | xsltproc " . $c->path_to("xsl/log2html.xsl") . " -"; $c->stash->{template} = 'log.tt'; - $c->stash->{logtext} = decode("utf-8", `ulimit -t 5 ; $pipeline`); + $c->stash->{logtext} = logContents($logPath); } elsif ($mode eq "raw") { $c->stash->{logPath} = $logPath; $c->stash->{finished} = $finished; $c->forward('Hydra::View::NixLog'); - return; } elsif ($mode eq "tail-reload") { diff --git a/src/root/log.tt b/src/root/log.tt index 19530b95..36eba0f0 100644 --- a/src/root/log.tt +++ b/src/root/log.tt @@ -8,10 +8,8 @@ [% END %]

-
- -
-[% logtext %] -
+
+[% HTML.escape(logtext) %]
+
[% END %] diff --git a/src/root/plain-reload.tt b/src/root/plain-reload.tt index c6ab6830..19afc8fc 100644 --- a/src/root/plain-reload.tt +++ b/src/root/plain-reload.tt @@ -1,11 +1,11 @@ -[% WRAPPER layout.tt title=title %] +[% WRAPPER layout.tt title="Log of " _ (step ? " step $step.stepnr of " : "") _ "build ${build.id} of job $build.project.name:$build.jobset.name:$build.job.name" %] [% PROCESS common.tt %] [% project = build.project %] [% jobset = build.jobset %] [% job = build.job %] -

Last 50 log lines of [% INCLUDE renderFullJobNameOfBuild %] build [% build.id %][%IF step %] step [% step.stepnr %][% END %]

+

Below are the last 50 log lines. The full log is also available.

[% IF reload %]