summaryrefslogtreecommitdiffstats
path: root/IntelFsp2Pkg/Tools
diff options
context:
space:
mode:
authorZeng, Star <star.zeng@intel.com>2016-12-05 10:52:45 +0800
committerJiewen Yao <jiewen.yao@intel.com>2016-12-05 14:17:23 +0800
commit60131098f302d9e449e95c53dec328aaf828076b (patch)
treebfb69b9311eac1a39c217b60d3107369e45a8cf4 /IntelFsp2Pkg/Tools
parent3883e2cb52fa1582165d6558c67649835d0eada3 (diff)
downloadedk2-60131098f302d9e449e95c53dec328aaf828076b.tar.gz
edk2-60131098f302d9e449e95c53dec328aaf828076b.tar.bz2
edk2-60131098f302d9e449e95c53dec328aaf828076b.zip
IntelFsp2Pkg: 41d739e breaks flat tree build
There may be no environment variable PACKAGES_PATH defined in flat tree, then 41d739e breaks flat tree build. This patch is to update GenCfgOpt.py to be compatible with both flat tree and package path build. Cc: Richard Thomaiyar <richard.marian.thomaiyar@intel.com> 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: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Richard Thomaiyar <richard.marian.thomaiyar@intel.com> Tested-by: Richard Thomaiyar <richard.marian.thomaiyar@intel.com>
Diffstat (limited to 'IntelFsp2Pkg/Tools')
-rw-r--r--IntelFsp2Pkg/Tools/GenCfgOpt.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/IntelFsp2Pkg/Tools/GenCfgOpt.py b/IntelFsp2Pkg/Tools/GenCfgOpt.py
index 0675b55c16..7658b7fc5c 100644
--- a/IntelFsp2Pkg/Tools/GenCfgOpt.py
+++ b/IntelFsp2Pkg/Tools/GenCfgOpt.py
@@ -524,11 +524,14 @@ EndList
IncludeFilePath = Match.group(1)
IncludeFilePath = self.ExpandMacros(IncludeFilePath)
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 PackagesPath:
+ 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
+ else:
+ IncludeDsc = open(IncludeFilePath, "r")
if IncludeDsc == None:
print("ERROR: Cannot open file '%s'" % IncludeFilePath)
raise SystemExit