diff --git a/src/lib/Hydra/View/NixClosure.pm b/src/lib/Hydra/View/NixClosure.pm index ec820b6d..bda483df 100644 --- a/src/lib/Hydra/View/NixClosure.pm +++ b/src/lib/Hydra/View/NixClosure.pm @@ -11,10 +11,9 @@ sub process { my @storePaths = @{$c->stash->{storePaths}}; - open(OUTPUT, "nix-store --export `nix-store -qR @storePaths` | gzip |"); - my $fh = new IO::Handle; - $fh->fdopen(fileno(OUTPUT), "r") or die; + + open $fh, "nix-store --export `nix-store -qR @storePaths` | gzip |"; $c->response->body($fh); diff --git a/src/lib/Hydra/View/NixDepGraph.pm b/src/lib/Hydra/View/NixDepGraph.pm index 03c9aa16..55af1d33 100644 --- a/src/lib/Hydra/View/NixDepGraph.pm +++ b/src/lib/Hydra/View/NixDepGraph.pm @@ -11,10 +11,9 @@ sub process { my @storePaths = @{$c->stash->{storePaths}}; - open(OUTPUT, "nix-store --query --graph @storePaths | dot -Tpng -Gbgcolor=transparent |"); - my $fh = new IO::Handle; - $fh->fdopen(fileno(OUTPUT), "r") or die; + + open $fh, "nix-store --query --graph @storePaths | dot -Tpng -Gbgcolor=transparent |"; $c->response->body($fh); diff --git a/src/lib/Hydra/View/NixNAR.pm b/src/lib/Hydra/View/NixNAR.pm index 4022431d..49bb27b6 100644 --- a/src/lib/Hydra/View/NixNAR.pm +++ b/src/lib/Hydra/View/NixNAR.pm @@ -10,15 +10,12 @@ sub process { $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; + + open $fh, "nix-store --dump '$storePath' | bzip2 |"; $c->response->body($fh); - undef $fh; - return 1; }