From 4b7d52b0467fd6e95fe65038a72515ccd96cd4f2 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Thu, 15 Dec 2022 02:33:35 +0000 Subject: [PATCH] zephyr/docker: pass http[s]_proxy variables to the container Support downloads from within the container. Signed-off-by: Marc Herbert (cherry picked from commit 424da2cd9d436ed42a8323b0200d0401e6be7f84) (cherry picked from commit dbcf7e18564cede175269ee228aa2357067ba352) --- scripts/sudo-cwd.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/scripts/sudo-cwd.sh b/scripts/sudo-cwd.sh index 2901fd95ee77..2c4d859345d8 100755 --- a/scripts/sudo-cwd.sh +++ b/scripts/sudo-cwd.sh @@ -63,7 +63,12 @@ exec_as_cwd_uid() # Double sudo to work around some funny restriction in # zephyr-build:/etc/sudoers: 'user' can do anything but... only as # root. - sudo sudo -u "$cwd_user" REAL_CC="$REAL_CC" "$@" + # Passing empty http[s]_proxy is OK + # shellcheck disable=SC2154 + sudo sudo -u "$cwd_user" REAL_CC="$REAL_CC" \ + http_proxy="$http_proxy" https_proxy="$https_proxy" \ + "$@" + exit "$?" }