hydra: make sure viewing logs works when logs are bz2'd

[?]
Aug 10, 2010, 1:11 PM
SAIUFDP3EFXENSB3XS4OKXNOTGLCYGPW3QNHCXASXBDEEDGYRWUAC

Dependencies

  • [2] U6UJRDG2 * Oops.
  • [3] Q24QXGSM * Don't do pretty printing for large logs, because the XSLT processing
  • [4] 6F4UNDTC * Provide access to the raw, non-pretty-printed logfiles.
  • [5] QE253KG4 * Option to show the tail of a log.
  • [6] C2DCO6AS
  • [7] YW66LY44 * hydra: enable pp'ing of logs for bigger files again
  • [8] 6M4KNDXX * Catalyst::View::Download::Plain doesn't like empty files.
  • [9] LBNVQXUB * Build the /build stuff in a separate controller.

Change contents

  • edit in src/lib/Hydra/Controller/Build.pm at line 108
    [4.334]
    [4.1997]
    my $fallbackpath = -f $path ? $path : "$path.bz2";
  • replacement in src/lib/Hydra/Controller/Build.pm at line 111
    [4.1998][4.0:70]()
    notFound($c, "Log file $path no longer exists.") unless -f $path;
    [4.1998]
    [3.198]
    notFound($c, "Log file $path no longer exists.") unless -f $fallbackpath;
    $path = $fallbackpath;
    my $pipestart = ($path =~ /.bz2$/ ? "cat $path | bzip2 -d" : "cat $path") ;
  • replacement in src/lib/Hydra/Controller/Build.pm at line 118
    [4.384][4.384:465]()
    my $pipeline = ($path =~ /.bz2$/ ? "cat $path | bzip2 -d" : "cat $path")
    [4.384]
    [4.465]
    my $pipeline = $pipestart
  • replacement in src/lib/Hydra/Controller/Build.pm at line 127
    [4.759][4.759:797]()
    $c->serve_static_file($path);
    [4.759]
    [4.797]
    $c->stash->{'plain'} = { data => (scalar `$pipestart`) || " " };
    $c->forward('Hydra::View::Plain');
  • replacement in src/lib/Hydra/Controller/Build.pm at line 132
    [4.49][2.0:79]()
    $c->stash->{'plain'} = { data => (scalar `tail -n 50 $path`) || " " };
    [4.49]
    [4.119]
    $c->stash->{'plain'} = { data => (scalar `$pipestart | tail -n 50`) || " " };