Fix nix-shell shebang scripts if -p is used

This commit is contained in:
Eelco Dolstra 2015-02-18 12:40:07 +01:00
parent 147deb236e
commit bb10010582

View file

@ -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;