From 5e5494a85213d535843e86e228f078381ab57459 Mon Sep 17 00:00:00 2001 From: zimbatm Date: Sun, 28 Feb 2016 13:27:43 +0000 Subject: [PATCH] make-wrapper.sh: add an --unset argument `--set FOO ""` is not strictly equivalent to `--unset FOO`. In the former case the environment variable still exists with an empty string as a value. --- pkgs/build-support/setup-hooks/make-wrapper.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/build-support/setup-hooks/make-wrapper.sh b/pkgs/build-support/setup-hooks/make-wrapper.sh index 5150b4f0218..7d0f88abb85 100644 --- a/pkgs/build-support/setup-hooks/make-wrapper.sh +++ b/pkgs/build-support/setup-hooks/make-wrapper.sh @@ -19,6 +19,12 @@ makeWrapper() { echo "export $varName=$value" >> $wrapper fi + if test "$p" = "--unset"; then + varName=${params[$((n + 1))]} + n=$((n + 1)) + echo "unset $varName" >> "$wrapper" + fi + if test "$p" = "--run"; then command=${params[$((n + 1))]} n=$((n + 1))