public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
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 v2 01/16] BaseTools: Treat GenFds.py as a python module
Date: Fri, 13 Jul 2018 18:18:32 +0800	[thread overview]
Message-ID: <20180713101847.7485-2-glin@suse.com> (raw)
In-Reply-To: <20180713101847.7485-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



  reply	other threads:[~2018-07-13 10:19 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-13 10:18 [PATCH v2 00/16] BaseTools: Adopt absolute import Gary Lin
2018-07-13 10:18 ` Gary Lin [this message]
2018-07-13 10:18 ` [PATCH v2 02/16] BaseTools: Use absolute import in GenFds Gary Lin
2018-07-13 10:18 ` [PATCH v2 03/16] BaseTools: Move OverrideAttribs to OptRomInfStatement.py Gary Lin
2018-07-13 10:18 ` [PATCH v2 04/16] BaseTools: Move FindExtendTool to GenFdsGlobalVariable.py Gary Lin
2018-07-13 10:18 ` [PATCH v2 05/16] BaseTools: Move ImageBinDict " Gary Lin
2018-07-13 10:18 ` [PATCH v2 06/16] BaseTools: Use absolute import in AutoGen Gary Lin
2018-07-13 10:18 ` [PATCH v2 07/16] BaseTools: Treat BPDG.py as a python module Gary Lin
2018-07-13 10:18 ` [PATCH v2 08/16] BaseTools: Use absolute import in BPDG Gary Lin
2018-07-13 10:18 ` [PATCH v2 09/16] BaseTools: Use absolute import in Common Gary Lin
2018-07-13 10:18 ` [PATCH v2 10/16] BaseTools: Treat Ecc.py as a python module Gary Lin
2018-07-13 10:18 ` [PATCH v2 11/16] BaseTools: Use absolute import in Ecc Gary Lin
2018-07-13 10:18 ` [PATCH v2 12/16] BaseTools: Use absolute import in Eot Gary Lin
2018-07-13 10:18 ` [PATCH v2 13/16] BaseTools: Use absolute import in Table Gary Lin
2018-07-13 10:18 ` [PATCH v2 14/16] BaseTools: Use absolute import in UPT Gary Lin
2018-07-13 10:18 ` [PATCH v2 15/16] BaseTools: Use absolute import in Workspace Gary Lin
2018-07-13 10:18 ` [PATCH v2 16/16] BaseTools: Use absolute import in Scripts Gary Lin
2018-07-13 15:07 ` [PATCH v2 00/16] BaseTools: Adopt absolute import Carsey, Jaben

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=20180713101847.7485-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