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>
This commit is contained in:
Jason1 Lin 2024-10-08 22:04:11 +08:00 committed by mergify[bot]
parent b7342074a6
commit e19cc32bce

View File

@ -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
}