about summary refs log tree commit diff
path: root/scripts/nix-build.in
diff options
context:
space:
mode:
authorMaxim Ivanov <ivanov.maxim@gmail.com>2014-03-29T11·43+0000
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-03-29T23·52+0100
commit59c90196850b6ac8c110e54c7f03d6417ed9bf61 (patch)
tree73102f294440948cd9060b412cc265374c9f65b9 /scripts/nix-build.in
parent1c2550a2ae826c422cf6d34f1c5c3e687474929d (diff)
Fix nix-shell for derivation with multiple outputs
If derivation declares multiple outputs and first (default) output
if not "out", then "nix-instantiate" calls return path with output
names appended after "!". Than suffix must be stripped before
ant path checks are done.
Diffstat (limited to 'scripts/nix-build.in')
-rwxr-xr-xscripts/nix-build.in1
1 files changed, 1 insertions, 0 deletions
diff --git a/scripts/nix-build.in b/scripts/nix-build.in
index d74884eadeb0..187371d6e192 100755
--- a/scripts/nix-build.in
+++ b/scripts/nix-build.in
@@ -196,6 +196,7 @@ foreach my $expr (@exprs) {
     if ($runEnv) {
         die "$0: a single derivation is required\n" if scalar @drvPaths != 1;
         my $drvPath = $drvPaths[0];
+        $drvPath = (split '!',$drvPath)[0];
         $drvPath = readlink $drvPath or die "cannot read symlink `$drvPath'" if -l $drvPath;
         my $drv = derivationFromPath($drvPath);