public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: rthomaiy <richard.marian.thomaiyar@intel.com>
To: edk2-devel@lists.01.org
Cc: Maurice Ma <maurice.ma@intel.com>,
	Jiewen Yao <jiewen.yao@intel.com>,
	Giri P Mudusuru <giri.p.mudusuru@intel.com>,
	Richard Thomaiyar <richard.marian.thomaiyar@intel.com>
Subject: [PATCH] IntelFsp2Pkg: Add PACKAGES_PATH support
Date: Fri, 25 Nov 2016 14:51:06 +0530	[thread overview]
Message-ID: <20161125092106.12296-1-richard.marian.thomaiyar@intel.com> (raw)

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

diff --git a/IntelFsp2Pkg/Tools/GenCfgOpt.py b/IntelFsp2Pkg/Tools/GenCfgOpt.py
index 654cdfc..0675b55 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()
-- 
2.9.0.windows.1



             reply	other threads:[~2016-11-25  9:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-25  9:21 rthomaiy [this message]
2016-11-29 16:43 ` [PATCH] IntelFsp2Pkg: Add PACKAGES_PATH support Yao, Jiewen
2016-11-29 18:11 ` Mudusuru, Giri P

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=20161125092106.12296-1-richard.marian.thomaiyar@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