]> git.proxmox.com Git - mirror_edk2.git/commitdiff
IntelFsp2Pkg: 41d739e breaks flat tree build
authorZeng, Star <star.zeng@intel.com>
Mon, 5 Dec 2016 02:52:45 +0000 (10:52 +0800)
committerJiewen Yao <jiewen.yao@intel.com>
Mon, 5 Dec 2016 06:17:23 +0000 (14:17 +0800)
There may be no environment variable PACKAGES_PATH defined
in flat tree, then 41d739e breaks flat tree build.
This patch is to update GenCfgOpt.py to be compatible with
both flat tree and package path build.

Cc: Richard Thomaiyar <richard.marian.thomaiyar@intel.com>
Cc: Maurice Ma <maurice.ma@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Richard Thomaiyar <richard.marian.thomaiyar@intel.com>
Tested-by: Richard Thomaiyar <richard.marian.thomaiyar@intel.com>
IntelFsp2Pkg/Tools/GenCfgOpt.py

index 0675b55c169cd016a9f9e6c50ba1a9770496cd61..7658b7fc5cb0782d65a302140df290ef34764586 100644 (file)
@@ -524,11 +524,14 @@ EndList
                                         IncludeFilePath = Match.group(1)\r
                                         IncludeFilePath = self.ExpandMacros(IncludeFilePath)\r
                                         PackagesPath = os.getenv("PACKAGES_PATH")\r
-                                        for PackagePath in PackagesPath.split(os.pathsep):\r
-                                            IncludeFilePathAbs = os.path.join(os.path.normpath(PackagePath), os.path.normpath(IncludeFilePath))\r
-                                            if os.path.exists(IncludeFilePathAbs):\r
-                                                IncludeDsc  = open(IncludeFilePathAbs, "r")\r
-                                                break\r
+                                        if PackagesPath:\r
+                                          for PackagePath in PackagesPath.split(os.pathsep):\r
+                                              IncludeFilePathAbs = os.path.join(os.path.normpath(PackagePath), os.path.normpath(IncludeFilePath))\r
+                                              if os.path.exists(IncludeFilePathAbs):\r
+                                                  IncludeDsc  = open(IncludeFilePathAbs, "r")\r
+                                                  break\r
+                                        else:\r
+                                          IncludeDsc  = open(IncludeFilePath, "r")\r
                                         if IncludeDsc == None:\r
                                             print("ERROR: Cannot open file '%s'" % IncludeFilePath)\r
                                             raise SystemExit\r