From: Gary Lin <glin@suse.com>
To: edk2-devel@lists.01.org
Cc: Yonghong Zhu <yonghong.zhu@intel.com>, Liming Gao <liming.gao@intel.com>
Subject: [PATCH 01/14] BaseTools: Treat GenFds.py as a python module
Date: Tue, 10 Jul 2018 11:30:54 +0800 [thread overview]
Message-ID: <20180710033107.32359-2-glin@suse.com> (raw)
In-Reply-To: <20180710033107.32359-1-glin@suse.com>
Since GenFds.py import modules from its own directory, add "-m" to the
python parameters so that they can import its own modules after adopting
absolute import.
Contributed-under: TianoCore Contribution Agreement 1.1
Cc: Yonghong Zhu <yonghong.zhu@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Gary Lin <glin@suse.com>
---
BaseTools/BinWrappers/PosixLike/GenFds | 2 +-
BaseTools/BinWrappers/WindowsLike/GenFds.bat | 3 ++-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/BaseTools/BinWrappers/PosixLike/GenFds b/BaseTools/BinWrappers/PosixLike/GenFds
index 01ae23ddeb4f..276c7ea20733 100755
--- a/BaseTools/BinWrappers/PosixLike/GenFds
+++ b/BaseTools/BinWrappers/PosixLike/GenFds
@@ -11,4 +11,4 @@ dir=$(dirname "$full_cmd")
cmd=${full_cmd##*/}
export PYTHONPATH="$dir/../../Source/Python${PYTHONPATH:+:"$PYTHONPATH"}"
-exec "${python_exe:-python}" "$dir/../../Source/Python/$cmd/$cmd.py" "$@"
+exec "${python_exe:-python}" -m $cmd.$cmd "$@"
diff --git a/BaseTools/BinWrappers/WindowsLike/GenFds.bat b/BaseTools/BinWrappers/WindowsLike/GenFds.bat
index 9fbb704a6eb0..98095cfbd439 100644
--- a/BaseTools/BinWrappers/WindowsLike/GenFds.bat
+++ b/BaseTools/BinWrappers/WindowsLike/GenFds.bat
@@ -1,3 +1,4 @@
@setlocal
@set ToolName=%~n0%
-@%PYTHON_HOME%\python.exe %BASE_TOOLS_PATH%\Source\Python\%ToolName%\%ToolName%.py %*
+@set PYTHONPATH=%PYTHONPATH%;%BASE_TOOLS_PATH%\Source\Python
+@%PYTHON_HOME%\python.exe -m %ToolName%.%ToolName% %*
--
2.18.0
next prev parent reply other threads:[~2018-07-10 3:31 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-10 3:30 [PATCH 00/14] BaseTools: Adopt absolute import Gary Lin
2018-07-10 3:30 ` Gary Lin [this message]
2018-07-10 3:30 ` [PATCH 02/14] BaseTools: Use absolute import in GenFds Gary Lin
2018-07-10 3:30 ` [PATCH 03/14] BaseTools: Move OverrideAttribs to OptRomInfStatement.py Gary Lin
2018-07-10 3:30 ` [PATCH 04/14] BaseTools: Move FindExtendTool to GenFdsGlobalVariable.py Gary Lin
2018-07-10 3:30 ` [PATCH 05/14] BaseTools: Move ImageBinDict " Gary Lin
2018-07-10 3:30 ` [PATCH 06/14] BaseTools: Use absolute import in AutoGen Gary Lin
2018-07-10 3:31 ` [PATCH 07/14] BaseTools: Use absolute import in BPDG Gary Lin
2018-07-12 0:52 ` Zhu, Yonghong
2018-07-12 4:23 ` Gary Lin
2018-07-10 3:31 ` [PATCH 08/14] BaseTools: Use absolute import in Common Gary Lin
2018-07-10 3:31 ` [PATCH 09/14] BaseTools: Use absolute import in ECC Gary Lin
2018-07-10 3:31 ` [PATCH 10/14] BaseTools: Use absolute import in Eot Gary Lin
2018-07-10 3:31 ` [PATCH 11/14] BaseTools: Use absolute import in Table Gary Lin
2018-07-10 3:31 ` [PATCH 12/14] BaseTools: Use absolute import in UPT Gary Lin
2018-07-10 3:31 ` [PATCH 13/14] BaseTools: Use absolute import in Workspace Gary Lin
2018-07-10 3:31 ` [PATCH 14/14] BaseTools: Use absolute import in Scripts Gary Lin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180710033107.32359-2-glin@suse.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox