]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFsp2Pkg/Tools/GenCfgOpt.py
IntelFsp2Pkg: 41d739e breaks flat tree build
[mirror_edk2.git] / IntelFsp2Pkg / Tools / GenCfgOpt.py
index 654cdfc835359d47367f3bd409d37d4c52a0f3bd..7658b7fc5cb0782d65a302140df290ef34764586 100644 (file)
@@ -523,9 +523,16 @@ EndList
                                     if Match:\r
                                         IncludeFilePath = Match.group(1)\r
                                         IncludeFilePath = self.ExpandMacros(IncludeFilePath)\r
-                                        try:\r
-                                            IncludeDsc  = open(IncludeFilePath, "r")\r
-                                        except:\r
+                                        PackagesPath = os.getenv("PACKAGES_PATH")\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
                                         NewDscLines = IncludeDsc.readlines()\r