From b12b2c74a3fbab681b76e33ca8d535dedf6c2b75 Mon Sep 17 00:00:00 2001 From: Laszlo Ersek Date: Wed, 14 Mar 2018 10:58:34 +0100 Subject: BaseTools/PosixLike: honor pre-set PYTHONPATH Utilities written in Python may depend on external (preinstalled) Python packages; for example, Ecc depends on "antlr_python_runtime-3.0.1". Such packages need not be installed system-wide, as long as they are reachable through PYTHONPATH. Therefore we shouldn't overwrite the user's PYTHONPATH with "BaseTools/Source/Python"; instead, we should prepend the latter to the former. Cc: Liming Gao Cc: Yonghong Zhu Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=896 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Laszlo Ersek Reviewed-by: Liming Gao --- BaseTools/BinWrappers/PosixLike/UPT | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'BaseTools/BinWrappers/PosixLike/UPT') diff --git a/BaseTools/BinWrappers/PosixLike/UPT b/BaseTools/BinWrappers/PosixLike/UPT index 214d88fff1..01ae23ddeb 100755 --- a/BaseTools/BinWrappers/PosixLike/UPT +++ b/BaseTools/BinWrappers/PosixLike/UPT @@ -10,5 +10,5 @@ full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a d dir=$(dirname "$full_cmd") cmd=${full_cmd##*/} -export PYTHONPATH="$dir/../../Source/Python" +export PYTHONPATH="$dir/../../Source/Python${PYTHONPATH:+:"$PYTHONPATH"}" exec "${python_exe:-python}" "$dir/../../Source/Python/$cmd/$cmd.py" "$@" -- cgit v1.2.3