summaryrefslogtreecommitdiffstats
path: root/edksetup.sh
diff options
context:
space:
mode:
authorFan, ZhijuX <zhijux.fan@intel.com>2019-04-30 10:16:01 +0800
committerFeng, Bob C <bob.c.feng@intel.com>2019-05-08 09:41:43 +0800
commitdf7c81b5b219c9aee776baa466dd64c9d318dd80 (patch)
tree990a9baf572aca1e138cd5bdbeeafe4be31f4e0e /edksetup.sh
parent26e2b295ec7a8d9866b8b4d2086fd5aa1aa1dc09 (diff)
downloadedk2-df7c81b5b219c9aee776baa466dd64c9d318dd80.tar.gz
edk2-df7c81b5b219c9aee776baa466dd64c9d318dd80.tar.bz2
edk2-df7c81b5b219c9aee776baa466dd64c9d318dd80.zip
BaseTools:The code used to test python module is moved to edksetup
BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1582 testing for presence of python modules should be done in edksetup to reduce impact on subsequent build times. This code currently exists in BaseTools/Tests/RunTest.py. This patch is going to fix this issue. Cc: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com> Reviewed-by: Bob Feng <bob.c.feng@intel.com>
Diffstat (limited to 'edksetup.sh')
-rwxr-xr-xedksetup.sh15
1 files changed, 13 insertions, 2 deletions
diff --git a/edksetup.sh b/edksetup.sh
index c7b2e1e201..ed9ceae85d 100755
--- a/edksetup.sh
+++ b/edksetup.sh
@@ -177,11 +177,22 @@ function SetupPython()
SetupPython3
}
+function TestUtilModule()
+{
+ if ( $PYTHON_COMMAND -c "import distutils.util" >/dev/null 2>&1 );then
+ return 1
+ else
+ echo Error: "No module named 'distutils.util"
+ return 0
+ fi
+}
+
function SourceEnv()
{
SetWorkspace &&
- SetupEnv
- SetupPython
+ SetupEnv &&
+ SetupPython &&
+ TestUtilModule
}
I=$#