public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Star Zeng <star.zeng@intel.com>
To: edk2-devel@lists.01.org
Cc: Star Zeng <star.zeng@intel.com>,
	Richard Thomaiyar <richard.marian.thomaiyar@intel.com>,
	Maurice Ma <maurice.ma@intel.com>,
	Jiewen Yao <jiewen.yao@intel.com>,
	Giri P Mudusuru <giri.p.mudusuru@intel.com>
Subject: [PATCH] IntelFsp2Pkg: 41d739e breaks flat tree build
Date: Mon,  5 Dec 2016 10:52:45 +0800	[thread overview]
Message-ID: <1480906365-51724-1-git-send-email-star.zeng@intel.com> (raw)

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>
---
 IntelFsp2Pkg/Tools/GenCfgOpt.py | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/IntelFsp2Pkg/Tools/GenCfgOpt.py b/IntelFsp2Pkg/Tools/GenCfgOpt.py
index 0675b55c169c..7658b7fc5cb0 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
-- 
2.7.0.windows.1



             reply	other threads:[~2016-12-05  2:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-05  2:52 Star Zeng [this message]
2016-12-05  3:19 ` [PATCH] IntelFsp2Pkg: 41d739e breaks flat tree build Thomaiyar, Richard Marian
2016-12-05  4:24 ` Thomaiyar, Richard Marian
2016-12-05  4:33 ` Yao, Jiewen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1480906365-51724-1-git-send-email-star.zeng@intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox