summaryrefslogtreecommitdiffstats
path: root/IntelFsp2Pkg
diff options
context:
space:
mode:
authorThomaiyar, Richard Marian <richard.marian.thomaiyar@intel.com>2016-11-25 17:21:06 +0800
committerJiewen Yao <jiewen.yao@intel.com>2016-11-30 14:37:45 +0800
commit41d739e4ecb189e1c5e478a55a8a21b0784f2c76 (patch)
tree3515097588ebb28af6793d64d4b4d602c58803a5 /IntelFsp2Pkg
parent6fee83fbcab75ee676699df3b3cf7f25fcbb3d26 (diff)
downloadedk2-41d739e4ecb189e1c5e478a55a8a21b0784f2c76.tar.gz
edk2-41d739e4ecb189e1c5e478a55a8a21b0784f2c76.tar.bz2
edk2-41d739e4ecb189e1c5e478a55a8a21b0784f2c76.zip
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>
Diffstat (limited to 'IntelFsp2Pkg')
-rw-r--r--IntelFsp2Pkg/Tools/GenCfgOpt.py10
1 files changed, 7 insertions, 3 deletions
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()