#! @perl@ -w -I@libexecdir@/nix use strict; my $addDrvLink = 0; my $addOutLink = 1; my $outLink; my $drvLink; my @instArgs = (); my @buildArgs = (); my @exprs = (); END { foreach my $fn (glob ".nix-build-tmp-*") { unlink $fn; } } sub intHandler { exit 1; } $SIG{'INT'} = 'intHandler'; for (my $n = 0; $n < scalar @ARGV; $n++) { my $arg = $ARGV[$n]; if ($arg eq "--help") { print STDERR <) {chomp; push @drvPaths, $_;} close DRVPATHS or exit 1; foreach my $drvPath (@drvPaths) { my $target = readlink $drvPath or die "cannot read symlink `$drvPath'"; print STDERR "store derivation is $target\n"; } # Build. my @outPaths; $pid = open(OUTPATHS, "-|") || exec "@bindir@/nix-store", "--add-root", $outLink, "--indirect", "-rv", @buildArgs, @drvPaths; while () {chomp; push @outPaths, $_;} close OUTPATHS or exit 1; foreach my $outPath (@outPaths) { my $target = readlink $outPath or die "cannot read symlink `$outPath'"; print "$target\n"; } }