1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-25 07:00:43 +00:00

stdenv: Don't use sed to build the setup script

This commit is contained in:
Eelco Dolstra 2014-07-01 17:39:07 +02:00
parent be3fc3ae2f
commit e3875297fa
3 changed files with 9 additions and 19 deletions

View file

@ -6,14 +6,11 @@ done
mkdir $out mkdir $out
echo "$preHook" > $out/setup echo "export SHELL=$shell" > $out/setup
echo "initialPath=\"$initialPath\"" >> $out/setup
echo "$preHook" >> $out/setup
cat "$setup" >> $out/setup cat "$setup" >> $out/setup
sed -e "s^@initialPath@^$initialPath^g" \
-e "s^@shell@^$shell^g" \
< $out/setup > $out/setup.tmp
mv $out/setup.tmp $out/setup
# Allow the user to install stdenv using nix-env and get the packages # Allow the user to install stdenv using nix-env and get the packages
# in stdenv. # in stdenv.
mkdir $out/nix-support mkdir $out/nix-support

View file

@ -112,11 +112,6 @@ let
builder = shell; builder = shell;
args = ["-e" ./builder.sh]; args = ["-e" ./builder.sh];
/* TODO: special-cased @var@ substitutions are ugly.
However, using substituteAll* from setup.sh seems difficult,
as setup.sh can't be directly sourced.
Suggestion: split similar utility functions into a separate script.
*/
setup = setupScript; setup = setupScript;

View file

@ -163,7 +163,7 @@ shopt -s nullglob
# Set up the initial path. # Set up the initial path.
PATH= PATH=
for i in @initialPath@; do for i in $initialPath; do
if [ "$i" = / ]; then i=; fi if [ "$i" = / ]; then i=; fi
addToSearchPath PATH $i/bin addToSearchPath PATH $i/bin
addToSearchPath PATH $i/sbin addToSearchPath PATH $i/sbin
@ -174,17 +174,15 @@ if [ "$NIX_DEBUG" = 1 ]; then
fi fi
# Execute the pre-hook.
export SHELL=@shell@
export CONFIG_SHELL="$SHELL"
if [ -z "$shell" ]; then export shell=@shell@; fi
runHook preHook
# Check that the pre-hook initialised SHELL. # Check that the pre-hook initialised SHELL.
if [ -z "$SHELL" ]; then echo "SHELL not set"; exit 1; fi if [ -z "$SHELL" ]; then echo "SHELL not set"; exit 1; fi
# Execute the pre-hook.
export CONFIG_SHELL="$SHELL"
if [ -z "$shell" ]; then export shell=$SHELL; fi
envHooks=() envHooks=()
crossEnvHooks=() crossEnvHooks=()