mirror of https://github.com/acidanthera/audk.git
IntelFsp2Pkg: Add PACKAGES_PATH support
Add PACKAGES_PATH support in GenCfgOpt.py 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: Richard Thomaiyar <richard.marian.thomaiyar@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
This commit is contained in:
parent
6fee83fbca
commit
41d739e4ec
|
@ -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()
|
||||
|
|
Loading…
Reference in New Issue