diff options
author | Laszlo Ersek <lersek@redhat.com> | 2018-03-14 10:58:34 +0100 |
---|---|---|
committer | Laszlo Ersek <lersek@redhat.com> | 2018-03-21 15:53:44 +0100 |
commit | b12b2c74a3fbab681b76e33ca8d535dedf6c2b75 (patch) | |
tree | 0fd1a66790a96e8d0f71eb16005b5b9b7981a25f /BaseTools/BinWrappers | |
parent | 28892d768be4ad731d754fb13de58368d524fd14 (diff) | |
download | edk2-b12b2c74a3fbab681b76e33ca8d535dedf6c2b75.tar.gz edk2-b12b2c74a3fbab681b76e33ca8d535dedf6c2b75.tar.bz2 edk2-b12b2c74a3fbab681b76e33ca8d535dedf6c2b75.zip |
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 <liming.gao@intel.com>
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=896
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools/BinWrappers')
-rwxr-xr-x | BaseTools/BinWrappers/PosixLike/BPDG | 2 | ||||
-rwxr-xr-x | BaseTools/BinWrappers/PosixLike/Ecc | 2 | ||||
-rwxr-xr-x | BaseTools/BinWrappers/PosixLike/GenDepex | 2 | ||||
-rwxr-xr-x | BaseTools/BinWrappers/PosixLike/GenFds | 2 | ||||
-rwxr-xr-x | BaseTools/BinWrappers/PosixLike/GenPatchPcdTable | 2 | ||||
-rwxr-xr-x | BaseTools/BinWrappers/PosixLike/PatchPcdValue | 2 | ||||
-rwxr-xr-x | BaseTools/BinWrappers/PosixLike/Pkcs7Sign | 2 | ||||
-rwxr-xr-x | BaseTools/BinWrappers/PosixLike/Rsa2048Sha256GenerateKeys | 2 | ||||
-rwxr-xr-x | BaseTools/BinWrappers/PosixLike/Rsa2048Sha256Sign | 2 | ||||
-rwxr-xr-x | BaseTools/BinWrappers/PosixLike/TargetTool | 2 | ||||
-rwxr-xr-x | BaseTools/BinWrappers/PosixLike/Trim | 2 | ||||
-rwxr-xr-x | BaseTools/BinWrappers/PosixLike/UPT | 2 | ||||
-rwxr-xr-x | BaseTools/BinWrappers/PosixLike/build | 2 |
13 files changed, 13 insertions, 13 deletions
diff --git a/BaseTools/BinWrappers/PosixLike/BPDG b/BaseTools/BinWrappers/PosixLike/BPDG index 214d88fff1..01ae23ddeb 100755 --- a/BaseTools/BinWrappers/PosixLike/BPDG +++ b/BaseTools/BinWrappers/PosixLike/BPDG @@ -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" "$@" diff --git a/BaseTools/BinWrappers/PosixLike/Ecc b/BaseTools/BinWrappers/PosixLike/Ecc index 214d88fff1..01ae23ddeb 100755 --- a/BaseTools/BinWrappers/PosixLike/Ecc +++ b/BaseTools/BinWrappers/PosixLike/Ecc @@ -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" "$@" diff --git a/BaseTools/BinWrappers/PosixLike/GenDepex b/BaseTools/BinWrappers/PosixLike/GenDepex index bdb6722a1f..dad174788b 100755 --- a/BaseTools/BinWrappers/PosixLike/GenDepex +++ b/BaseTools/BinWrappers/PosixLike/GenDepex @@ -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/AutoGen/$cmd.py" "$@" diff --git a/BaseTools/BinWrappers/PosixLike/GenFds b/BaseTools/BinWrappers/PosixLike/GenFds index 214d88fff1..01ae23ddeb 100755 --- a/BaseTools/BinWrappers/PosixLike/GenFds +++ b/BaseTools/BinWrappers/PosixLike/GenFds @@ -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" "$@" diff --git a/BaseTools/BinWrappers/PosixLike/GenPatchPcdTable b/BaseTools/BinWrappers/PosixLike/GenPatchPcdTable index 214d88fff1..01ae23ddeb 100755 --- a/BaseTools/BinWrappers/PosixLike/GenPatchPcdTable +++ b/BaseTools/BinWrappers/PosixLike/GenPatchPcdTable @@ -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" "$@" diff --git a/BaseTools/BinWrappers/PosixLike/PatchPcdValue b/BaseTools/BinWrappers/PosixLike/PatchPcdValue index 214d88fff1..01ae23ddeb 100755 --- a/BaseTools/BinWrappers/PosixLike/PatchPcdValue +++ b/BaseTools/BinWrappers/PosixLike/PatchPcdValue @@ -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" "$@" diff --git a/BaseTools/BinWrappers/PosixLike/Pkcs7Sign b/BaseTools/BinWrappers/PosixLike/Pkcs7Sign index 214d88fff1..01ae23ddeb 100755 --- a/BaseTools/BinWrappers/PosixLike/Pkcs7Sign +++ b/BaseTools/BinWrappers/PosixLike/Pkcs7Sign @@ -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" "$@" diff --git a/BaseTools/BinWrappers/PosixLike/Rsa2048Sha256GenerateKeys b/BaseTools/BinWrappers/PosixLike/Rsa2048Sha256GenerateKeys index 2cddde9d4f..1bc1054a34 100755 --- a/BaseTools/BinWrappers/PosixLike/Rsa2048Sha256GenerateKeys +++ b/BaseTools/BinWrappers/PosixLike/Rsa2048Sha256GenerateKeys @@ -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/Rsa2048Sha256Sign/$cmd.py" "$@" diff --git a/BaseTools/BinWrappers/PosixLike/Rsa2048Sha256Sign b/BaseTools/BinWrappers/PosixLike/Rsa2048Sha256Sign index 214d88fff1..01ae23ddeb 100755 --- a/BaseTools/BinWrappers/PosixLike/Rsa2048Sha256Sign +++ b/BaseTools/BinWrappers/PosixLike/Rsa2048Sha256Sign @@ -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" "$@" diff --git a/BaseTools/BinWrappers/PosixLike/TargetTool b/BaseTools/BinWrappers/PosixLike/TargetTool index 214d88fff1..01ae23ddeb 100755 --- a/BaseTools/BinWrappers/PosixLike/TargetTool +++ b/BaseTools/BinWrappers/PosixLike/TargetTool @@ -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" "$@" diff --git a/BaseTools/BinWrappers/PosixLike/Trim b/BaseTools/BinWrappers/PosixLike/Trim index 7cac4f7c4f..6c8dde5bec 100755 --- a/BaseTools/BinWrappers/PosixLike/Trim +++ b/BaseTools/BinWrappers/PosixLike/Trim @@ -10,5 +10,5 @@ full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a d dir=$(dirname "$full_cmd") exe=$(basename "$full_cmd") -export PYTHONPATH="$dir/../../Source/Python" +export PYTHONPATH="$dir/../../Source/Python${PYTHONPATH:+:"$PYTHONPATH"}" exec "${python_exe:-python}" "$dir/../../Source/Python/$exe/$exe.py" "$@" 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" "$@" diff --git a/BaseTools/BinWrappers/PosixLike/build b/BaseTools/BinWrappers/PosixLike/build index 214d88fff1..01ae23ddeb 100755 --- a/BaseTools/BinWrappers/PosixLike/build +++ b/BaseTools/BinWrappers/PosixLike/build @@ -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" "$@" |