IntelFsp2Pkg: Add PACKAGES_PATH support

Add PACKAGES_PATH support in GenCfgOpt.py

Cc: Maurice Ma <[email protected]>
Cc: Jiewen Yao <[email protected]>
Cc: Giri P Mudusuru <[email protected]>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Richard Thomaiyar <[email protected]>
Reviewed-by: Jiewen Yao <[email protected]>
Reviewed-by: Giri P Mudusuru <[email protected]>
This commit is contained in:
Thomaiyar, Richard Marian authored and Jiewen Yao committed 2016-11-30 14:37:45 +08:00
1 parent 6fee83fbca
commit 41d739e4ec
1 file changed
+7 -3
+7 -3
View File
@@ -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()