]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Add error condition for the path in PACKAGES_PATH env
authorZhu, Yonghong <yonghong.zhu@intel.com>
Wed, 18 May 2016 01:59:20 +0000 (09:59 +0800)
committerLiming Gao <liming.gao@intel.com>
Mon, 23 May 2016 09:05:48 +0000 (17:05 +0800)
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>

BaseTools/Source/Python/build/build.py

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