public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] IntelFsp2Pkg: Add PACKAGES_PATH support
@ 2016-11-25  9:21 rthomaiy
  2016-11-29 16:43 ` Yao, Jiewen
  2016-11-29 18:11 ` Mudusuru, Giri P
  0 siblings, 2 replies; 3+ messages in thread
From: rthomaiy @ 2016-11-25  9:21 UTC (permalink / raw)
  To: edk2-devel; +Cc: Maurice Ma, Jiewen Yao, Giri P Mudusuru, Richard Thomaiyar

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



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] IntelFsp2Pkg: Add PACKAGES_PATH support
  2016-11-25  9:21 [PATCH] IntelFsp2Pkg: Add PACKAGES_PATH support rthomaiy
@ 2016-11-29 16:43 ` Yao, Jiewen
  2016-11-29 18:11 ` Mudusuru, Giri P
  1 sibling, 0 replies; 3+ messages in thread
From: Yao, Jiewen @ 2016-11-29 16:43 UTC (permalink / raw)
  To: Thomaiyar, Richard Marian, edk2-devel@lists.01.org

Reviewed-by: jiewen.yao@intel.com

> -----Original Message-----
> From: Thomaiyar, Richard Marian
> Sent: Friday, November 25, 2016 5:21 PM
> To: edk2-devel@lists.01.org
> Cc: Ma, Maurice <maurice.ma@intel.com>; Yao, Jiewen
> <jiewen.yao@intel.com>; Mudusuru, Giri P <giri.p.mudusuru@intel.com>;
> Thomaiyar, Richard Marian <richard.marian.thomaiyar@intel.com>
> Subject: [PATCH] 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>
> ---
>  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



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] IntelFsp2Pkg: Add PACKAGES_PATH support
  2016-11-25  9:21 [PATCH] IntelFsp2Pkg: Add PACKAGES_PATH support rthomaiy
  2016-11-29 16:43 ` Yao, Jiewen
@ 2016-11-29 18:11 ` Mudusuru, Giri P
  1 sibling, 0 replies; 3+ messages in thread
From: Mudusuru, Giri P @ 2016-11-29 18:11 UTC (permalink / raw)
  To: Thomaiyar, Richard Marian, edk2-devel@lists.01.org
  Cc: Ma, Maurice, Yao, Jiewen

Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>


> -----Original Message-----
> From: Thomaiyar, Richard Marian
> Sent: Friday, November 25, 2016 1:21 AM
> To: edk2-devel@lists.01.org
> Cc: Ma, Maurice <maurice.ma@intel.com>; Yao, Jiewen
> <jiewen.yao@intel.com>; Mudusuru, Giri P <giri.p.mudusuru@intel.com>;
> Thomaiyar, Richard Marian <richard.marian.thomaiyar@intel.com>
> Subject: [PATCH] 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>
> ---
>  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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-11-29 18:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-25  9:21 [PATCH] IntelFsp2Pkg: Add PACKAGES_PATH support rthomaiy
2016-11-29 16:43 ` Yao, Jiewen
2016-11-29 18:11 ` Mudusuru, Giri P

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox