From bb100105820496a8a993102c88b7b63fd7eb4282 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 18 Feb 2015 12:40:07 +0100 Subject: [PATCH] Fix nix-shell shebang scripts if -p is used --- scripts/nix-build.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/nix-build.in b/scripts/nix-build.in index 7e1f28870..b497d8f5a 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;