From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 70FD781C76 for ; Tue, 29 Nov 2016 08:43:59 -0800 (PST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP; 29 Nov 2016 08:43:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,717,1473145200"; d="scan'208";a="197027028" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga004.fm.intel.com with ESMTP; 29 Nov 2016 08:43:31 -0800 Received: from fmsmsx156.amr.corp.intel.com (10.18.116.74) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 29 Nov 2016 08:43:31 -0800 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx156.amr.corp.intel.com (10.18.116.74) with Microsoft SMTP Server (TLS) id 14.3.248.2; Tue, 29 Nov 2016 08:43:30 -0800 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.239]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.96]) with mapi id 14.03.0248.002; Wed, 30 Nov 2016 00:43:27 +0800 From: "Yao, Jiewen" To: "Thomaiyar, Richard Marian" , "edk2-devel@lists.01.org" Thread-Topic: [PATCH] IntelFsp2Pkg: Add PACKAGES_PATH support Thread-Index: AQHSRv1SYF4NUFeW7E24FyCvH6cW8KDwMWDg Date: Tue, 29 Nov 2016 16:43:26 +0000 Message-ID: <74D8A39837DF1E4DA445A8C0B3885C50386DC3DE@shsmsx102.ccr.corp.intel.com> References: <20161125092106.12296-1-richard.marian.thomaiyar@intel.com> In-Reply-To: <20161125092106.12296-1-richard.marian.thomaiyar@intel.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] IntelFsp2Pkg: Add PACKAGES_PATH support X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Nov 2016 16:43:59 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable 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 ; Yao, Jiewen > ; Mudusuru, Giri P ; > Thomaiyar, Richard Marian > Subject: [PATCH] IntelFsp2Pkg: Add PACKAGES_PATH support >=20 > Add PACKAGES_PATH support in GenCfgOpt.py >=20 > Cc: Maurice Ma > Cc: Jiewen Yao > Cc: Giri P Mudusuru > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Richard Thomaiyar > --- > IntelFsp2Pkg/Tools/GenCfgOpt.py | 10 +++++++--- > 1 file changed, 7 insertions(+), 3 deletions(-) >=20 > 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 =3D > Match.group(1) > IncludeFilePath =3D > self.ExpandMacros(IncludeFilePath) > - try: > - IncludeDsc =3D > open(IncludeFilePath, "r") > - except: > + PackagesPath =3D > os.getenv("PACKAGES_PATH") > + for PackagePath in > PackagesPath.split(os.pathsep): > + IncludeFilePathAbs =3D > os.path.join(os.path.normpath(PackagePath), > os.path.normpath(IncludeFilePath)) > + if > os.path.exists(IncludeFilePathAbs): > + IncludeDsc =3D > open(IncludeFilePathAbs, "r") > + break > + if IncludeDsc =3D=3D None: > print("ERROR: > Cannot open file '%s'" % IncludeFilePath) > raise SystemExit > NewDscLines =3D > IncludeDsc.readlines() > -- > 2.9.0.windows.1