Reviewed-by: Giri P Mudusuru <giri.p.mudus...@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...@intel.com>; Yao, Jiewen > <jiewen....@intel.com>; Mudusuru, Giri P <giri.p.mudus...@intel.com>; > Thomaiyar, Richard Marian <richard.marian.thomai...@intel.com> > Subject: [PATCH] IntelFsp2Pkg: Add PACKAGES_PATH support > > Add PACKAGES_PATH support in GenCfgOpt.py > > Cc: Maurice Ma <maurice...@intel.com> > Cc: Jiewen Yao <jiewen....@intel.com> > Cc: Giri P Mudusuru <giri.p.mudus...@intel.com> > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Richard Thomaiyar <richard.marian.thomai...@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 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel