* Move everything up one directory.
This commit is contained in:
25
src/lib/Hydra/View/NixNAR.pm
Normal file
25
src/lib/Hydra/View/NixNAR.pm
Normal file
@@ -0,0 +1,25 @@
|
||||
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;
|
Reference in New Issue
Block a user