summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason1 Lin <jason1.lin@intel.com>2024-10-08 22:04:11 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-10-17 06:53:34 +0000
commite19cc32bce466fb1c175f7d44708c2ebb45802a7 (patch)
tree8954a9ef2cbbc4c4b12fe3dbf179471262d1b70f
parentb7342074a649599078553e33acd6d7a79e950683 (diff)
downloadedk2-e19cc32bce466fb1c175f7d44708c2ebb45802a7.tar.gz
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 <jason1.lin@intel.com>
-rwxr-xr-xedksetup.sh12
1 files 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
}