mirror of
https://github.com/acidanthera/audk.git
synced 2025-04-08 17:05:09 +02:00
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3165 There are 2 reasons to convert Split tool from C to Python. 1. We are in the process of moving the Basetools Python code to a separate repository. But there still are many C tools under edk2/BaseTools. To make all Basetools be in the separate repo, we can convert the C tools to Python tools. 2. The original Split tool is very slow. This python tool can reduce 90% time. Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Yuwei Chen <yuwei.chen@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Yuwei Chen <yuwei.chen@intel.com>
15 lines
571 B
Bash
Executable File
15 lines
571 B
Bash
Executable File
#!/usr/bin/env bash
|
|
#python `dirname $0`/RunToolFromSource.py `basename $0` $*
|
|
|
|
# If a ${PYTHON_COMMAND} command is available, use it in preference to python
|
|
if command -v ${PYTHON_COMMAND} >/dev/null 2>&1; then
|
|
python_exe=${PYTHON_COMMAND}
|
|
fi
|
|
|
|
full_cmd=${BASH_SOURCE:-$0} # see http://mywiki.wooledge.org/BashFAQ/028 for a discussion of why $0 is not a good choice here
|
|
dir=$(dirname "$full_cmd")
|
|
cmd=${full_cmd##*/}
|
|
|
|
export PYTHONPATH="$dir/../../Source/Python${PYTHONPATH:+:"$PYTHONPATH"}"
|
|
exec "${python_exe:-python}" "$dir/../../Source/Python/$cmd/$cmd.py" "$@"
|