about summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2015-02-18T11·40+0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2015-02-18T11·40+0100
commitbb100105820496a8a993102c88b7b63fd7eb4282 (patch)
treeb69e3852b7ef1ec5d1939a53ba04d7f6d9607bd4 /scripts
parent147deb236ebc8474d0e53cb90b23f1d722486bb6 (diff)
Fix nix-shell shebang scripts if -p is used
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/nix-build.in2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/nix-build.in b/scripts/nix-build.in
index 7e1f28870309..b497d8f5acaf 100755
--- a/scripts/nix-build.in
+++ b/scripts/nix-build.in
@@ -231,7 +231,7 @@ foreach my $expr (@exprs) {
         # If we're in a #! script, interpret filenames relative to the
         # script.
         $expr = dirname(Cwd::abs_path($script)) . "/" . $expr
-            if $inShebang && $expr !~ /^\//;
+            if $inShebang && !$packages && $expr !~ /^\//;
 
         # !!! would prefer the perl 5.8.0 pipe open feature here.
         my $pid = open(DRVPATHS, "-|") || exec "$Nix::Config::binDir/nix-instantiate", "--add-root", $drvLink, "--indirect", @instArgs, $expr;