From: Thomaiyar, Richard Marian Date: Fri, 25 Nov 2016 09:21:06 +0000 (+0800) Subject: IntelFsp2Pkg: Add PACKAGES_PATH support X-Git-Tag: edk2-stable201903~5045 X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=commitdiff_plain;h=41d739e4ecb189e1c5e478a55a8a21b0784f2c76 IntelFsp2Pkg: Add PACKAGES_PATH support Add PACKAGES_PATH support in GenCfgOpt.py Cc: Maurice Ma Cc: Jiewen Yao Cc: Giri P Mudusuru Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Richard Thomaiyar Reviewed-by: Jiewen Yao Reviewed-by: Giri P Mudusuru --- diff --git a/IntelFsp2Pkg/Tools/GenCfgOpt.py b/IntelFsp2Pkg/Tools/GenCfgOpt.py index 654cdfc835..0675b55c16 100644 --- a/IntelFsp2Pkg/Tools/GenCfgOpt.py +++ b/IntelFsp2Pkg/Tools/GenCfgOpt.py @@ -523,9 +523,13 @@ EndList if Match: IncludeFilePath = Match.group(1) IncludeFilePath = self.ExpandMacros(IncludeFilePath) - try: - IncludeDsc = open(IncludeFilePath, "r") - except: + PackagesPath = os.getenv("PACKAGES_PATH") + for PackagePath in PackagesPath.split(os.pathsep): + IncludeFilePathAbs = os.path.join(os.path.normpath(PackagePath), os.path.normpath(IncludeFilePath)) + if os.path.exists(IncludeFilePathAbs): + IncludeDsc = open(IncludeFilePathAbs, "r") + break + if IncludeDsc == None: print("ERROR: Cannot open file '%s'" % IncludeFilePath) raise SystemExit NewDscLines = IncludeDsc.readlines()