From 8bddc3d406a07fcd10f2d08eaa81a2c4f4d66f1c Mon Sep 17 00:00:00 2001 From: Shea Levy Date: Thu, 8 Sep 2016 09:10:50 -0400 Subject: [PATCH] Fix early removal of rc-file for nix-shell BASH_ENV causes all non-interactive shells called via eg. /etc/bashrc to remove the rc-file before the main shell gets to run it. Completion scripts will often do this. Fixes #976. Adapted from and fixes #1034. --- scripts/nix-build.in | 2 -- 1 file changed, 2 deletions(-) diff --git a/scripts/nix-build.in b/scripts/nix-build.in index b93e5ab13..c7a60623e 100755 --- a/scripts/nix-build.in +++ b/scripts/nix-build.in @@ -288,7 +288,6 @@ foreach my $expr (@exprs) { writeFile( $rcfile, "rm -rf '$tmpDir'; " . - 'unset BASH_ENV; ' . '[ -n "$PS1" ] && [ -e ~/.bashrc ] && source ~/.bashrc; ' . ($pure ? '' : 'p=$PATH; ' ) . 'dontAddDisableDepTrack=1; ' . @@ -302,7 +301,6 @@ foreach my $expr (@exprs) { 'shopt -u nullglob; ' . 'unset TZ; ' . (defined $ENV{'TZ'} ? "export TZ='${ENV{'TZ'}}'; " : '') . $envCommand); - $ENV{BASH_ENV} = $rcfile; my @args = ($ENV{NIX_BUILD_SHELL} // "bash"); push @args, "--rcfile" if $interactive; push @args, $rcfile;