From e19cc32bce466fb1c175f7d44708c2ebb45802a7 Mon Sep 17 00:00:00 2001 From: Jason1 Lin Date: Tue, 8 Oct 2024 22:04:11 +0800 Subject: edksetup.sh: Fix the Issue of PYTHON_COMMAND Un-Configurable - With the commit e6447d2a08f5ca585816d093e79a01dad3781f98 introduced, there do not have chance for caller to configure the PYTHON_COMMAND environment variable outside of this script. - All the configured value would be assigned into "python3" forcedly, without checking the environment variable is set or not. - This patch included the below changes, - Check the "PYTHON_COMMAND" is set or not before assigning the default value "python3" on it. - Rename the function naming into "SetupPythonCommand" to align its functionality. Signed-off-by: Jason1 Lin --- edksetup.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/edksetup.sh b/edksetup.sh index cab3a8c113..0ae32ea8cc 100755 --- a/edksetup.sh +++ b/edksetup.sh @@ -103,14 +103,22 @@ SetupEnv() fi } -SetupPython3() +SetupPythonCommand() { + # + # If PYTHON_COMMAND is already set, then we can return right now + # + if [ -n "$PYTHON_COMMAND" ] + then + return 0 + fi + export PYTHON_COMMAND=python3 } SourceEnv() { - SetupPython3 + SetupPythonCommand SetWorkspace SetupEnv } -- cgit