* Generate NAR archives on the fly. Necessary for producing channels

[?]
Feb 19, 2009, 11:43 PM
NYC3LZKHWRIP2VJDCO3UVPR6TR7JURVX5NBS4H2AOOOG3ZG5G6FAC

Dependencies

  • [2] IWVA2P2Y * Generate manifests on demand. Next step: generate NAR archives on
  • [3] L5VIEXSC * Allow downloading of build products.
  • [4] 2GK5DOU7 * Downloading closures.
  • [5] BA46C5LN * Pretty-print the logs.
  • [6] J5UVLXOK * Start of a basic Catalyst web interface.
  • [7] SHBLLAVH * More global substitution.
  • [*] PKPWUHUX * Idem.

Change contents

  • replacement in src/Hydra/lib/Hydra/Controller/Root.pm at line 715
    [2.182][3.230:231](),[3.230][3.230:231]()
    [2.182]
    [2.183]
    return error($c, "Path " . $build->outpath . " is no longer available.") unless isValidPath($build->outpath);
  • edit in src/Hydra/lib/Hydra/Controller/Root.pm at line 720
    [2.291]
    [2.291]
    sub nar :Local {
    my ($self, $c, @rest) = @_;
  • edit in src/Hydra/lib/Hydra/Controller/Root.pm at line 725
    [2.292]
    [2.292]
    my $path .= "/" . join("/", @rest);
  • edit in src/Hydra/lib/Hydra/Controller/Root.pm at line 727
    [2.293]
    [3.2597]
    return error($c, "Path " . $path . " is no longer available.") unless isValidPath($path);
    $c->stash->{current_view} = 'Hydra::View::NixNAR';
    $c->stash->{storePath} = $path;
    }
  • edit in src/Hydra/lib/Hydra/View/NixClosure.pm at line 6
    [3.812][3.812:832]()
    use POSIX qw(dup2);
  • replacement in src/Hydra/lib/Hydra/View/NixManifest.pm at line 15
    [2.594][2.594:599]()
    [2.594]
    [2.599]
  • replacement in src/Hydra/lib/Hydra/View/NixManifest.pm at line 44
    [2.1448][2.1448:1485]()
    " StorePath: $path\n" .
    [2.1448]
    [2.1485]
    " StorePath: ${path}y\n" .
  • replacement in src/Hydra/lib/Hydra/View/NixManifest.pm at line 47
    [2.1556][2.1556:1588]()
    " Hash: $hash\n" .
    [2.1556]
    [2.1588]
    " NarHash: $hash\n" .
  • file addition: NixNAR.pm (----------)
    [9.646]
    package Hydra::View::NixNAR;
    use strict;
    use base qw/Catalyst::View/;
    sub process {
    my ($self, $c) = @_;
    my $storePath = $c->stash->{storePath};
    $c->response->content_type('application/x-nix-archive'); # !!! check MIME type
    open(OUTPUT, "nix-store --dump '$storePath' | bzip2 |");
    my $fh = new IO::Handle;
    $fh->fdopen(fileno(OUTPUT), "r") or die;
    $c->response->body($fh);
    undef $fh;
    return 1;
    }
    1;