From b3d3700e113c584329473dbfbd3149c9ef8566e8 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 19 Oct 2006 17:30:09 +0000 Subject: [PATCH] * nix-build: check the exit status of `nix-store -r'. --- scripts/nix-build.in | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/nix-build.in b/scripts/nix-build.in index 2bea463d3..dc7dc6e85 100644 --- a/scripts/nix-build.in +++ b/scripts/nix-build.in @@ -121,12 +121,14 @@ foreach my $expr (@exprs) { } # Build. - my $outPaths = `@bindir@/nix-store --add-root "$outLink" --indirect -rv @buildArgs @drvPaths`; - my @outPaths = split ' ', $outPaths; - + 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; print "$target\n"; } - }