From 994cb768506d827f03295d23b2cb672aa00c00f5 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Tue, 28 Nov 2017 15:03:50 -0500 Subject: [PATCH] cc-wrapper: Don't leave CMD defined after setup hook Rename to `cmd` too, as uppercase typically means the variable is exported. --- pkgs/build-support/cc-wrapper/setup-hook.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/build-support/cc-wrapper/setup-hook.sh b/pkgs/build-support/cc-wrapper/setup-hook.sh index a8f29bd5877..c55bcf75a9e 100644 --- a/pkgs/build-support/cc-wrapper/setup-hook.sh +++ b/pkgs/build-support/cc-wrapper/setup-hook.sh @@ -138,15 +138,15 @@ export NIX_${role}CC=@out@ export ${role}CC=@named_cc@ export ${role}CXX=@named_cxx@ -for CMD in \ +for cmd in \ ar as nm objcopy ranlib strip strings size ld windres do if - PATH=$_PATH type -p "@targetPrefix@$CMD" > /dev/null + PATH=$_PATH type -p "@targetPrefix@${cmd}" > /dev/null then - export "${role}$(echo "$CMD" | tr "[:lower:]" "[:upper:]")=@targetPrefix@${CMD}"; + export "${role}$(echo "$cmd" | tr "[:lower:]" "[:upper:]")=@targetPrefix@${cmd}"; fi done # No local scope in sourced file -unset role +unset -v role cmd