2009-02-27 15:31:49 +00:00
|
|
|
package Hydra::View::NixDepGraph;
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
use base qw/Catalyst::View/;
|
|
|
|
use IO::Pipe;
|
|
|
|
|
|
|
|
sub process {
|
|
|
|
my ($self, $c) = @_;
|
|
|
|
|
|
|
|
$c->response->content_type('image/png');
|
|
|
|
|
|
|
|
my @storePaths = @{$c->stash->{storePaths}};
|
|
|
|
|
|
|
|
my $fh = new IO::Handle;
|
2009-03-11 14:44:34 +00:00
|
|
|
|
|
|
|
open $fh, "nix-store --query --graph @storePaths | dot -Tpng -Gbgcolor=transparent |";
|
2009-02-27 15:31:49 +00:00
|
|
|
|
|
|
|
$c->response->body($fh);
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
1;
|