BaseTools: Add error condition for the path in PACKAGES_PATH env

This patch adds two error conditions:
1) if one path in PACKAGES_PATH doesn't exist.
2) if the space exists in the PACKAGES_PATH.

In V2, highlight one path in PACKAGES_PATH env doesn't exist.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Reviewed by: Andrew Fish <afish@apple.com>
This commit is contained in:
Zhu, Yonghong 2016-05-18 09:59:20 +08:00 committed by Liming Gao
parent 28c1711d4f
commit f6190a01c1
1 changed files with 6 additions and 0 deletions

View File

@ -110,6 +110,12 @@ def CheckEnvVariable():
# set multiple workspace
PackagesPath = os.getenv("PACKAGES_PATH")
mws.setWs(WorkspaceDir, PackagesPath)
if mws.PACKAGES_PATH:
for Path in mws.PACKAGES_PATH:
if not os.path.exists(Path):
EdkLogger.error("build", FILE_NOT_FOUND, "One Path in PACKAGES_PATH doesn't exist", ExtraData="%s" % Path)
elif ' ' in Path:
EdkLogger.error("build", FORMAT_NOT_SUPPORTED, "No space is allowed in PACKAGES_PATH", ExtraData=Path)
#
# Check EFI_SOURCE (Edk build convention). EDK_SOURCE will always point to ECP