From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by ml01.01.org (Postfix) with ESMTP id 94DF11A1DFE for ; Wed, 17 Aug 2016 22:47:05 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP; 17 Aug 2016 22:47:05 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,537,1464678000"; d="scan'208";a="1043254424" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by fmsmga002.fm.intel.com with ESMTP; 17 Aug 2016 22:47:05 -0700 Received: from fmsmsx117.amr.corp.intel.com (10.18.116.17) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 17 Aug 2016 22:47:05 -0700 Received: from shsmsx151.ccr.corp.intel.com (10.239.6.50) by fmsmsx117.amr.corp.intel.com (10.18.116.17) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 17 Aug 2016 22:47:04 -0700 Received: from shsmsx102.ccr.corp.intel.com ([169.254.2.147]) by SHSMSX151.ccr.corp.intel.com ([169.254.3.150]) with mapi id 14.03.0248.002; Thu, 18 Aug 2016 13:47:01 +0800 From: "Gao, Liming" To: "Zhu, Yonghong" , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [Patch] BaseTools: check CONF_PATH env to get the configure files Thread-Index: AQHR+Pg7CUrxi7Ykd0+IeItS5ytodqBONdzA Date: Thu, 18 Aug 2016 05:47:01 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A1155EC6F5@shsmsx102.ccr.corp.intel.com> References: <1471487304-99892-1-git-send-email-yonghong.zhu@intel.com> In-Reply-To: <1471487304-99892-1-git-send-email-yonghong.zhu@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Patch] BaseTools: check CONF_PATH env to get the configure files 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: Thu, 18 Aug 2016 05:47:05 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Liming Gao > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Yonghong Zhu > Sent: Thursday, August 18, 2016 10:28 AM > To: edk2-devel@lists.01.org > Cc: Gao, Liming > Subject: [edk2] [Patch] BaseTools: check CONF_PATH env to get the > configure files >=20 > Add CONF_PATH env check. First priority is user set the conf dir by > --conf option, then the CONF_PATH env, the last one is the standard > WORKSPACE(PACKAGE_PATH)/Conf. > Also print the conf path directory in the build log. >=20 > Cc: Liming Gao > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Yonghong Zhu > --- > BaseTools/Source/Python/GenFds/GenFds.py | 7 +++++-- > BaseTools/Source/Python/build/build.py | 9 ++++++--- > 2 files changed, 11 insertions(+), 5 deletions(-) >=20 > diff --git a/BaseTools/Source/Python/GenFds/GenFds.py > b/BaseTools/Source/Python/GenFds/GenFds.py > index 68232c5..f2de47e 100644 > --- a/BaseTools/Source/Python/GenFds/GenFds.py > +++ b/BaseTools/Source/Python/GenFds/GenFds.py > @@ -150,12 +150,15 @@ def main(): > if not os.path.isabs(ConfDirectoryPath): > # Since alternate directory name is not absolute, the al= ternate > directory is located within the WORKSPACE > # This also handles someone specifying the Conf director= y in the > workspace. Using --conf=3DConf > ConfDirectoryPath =3D > os.path.join(GenFdsGlobalVariable.WorkSpaceDir, ConfDirectoryPath) > else: > - # Get standard WORKSPACE/Conf, use the absolute path to the > WORKSPACE/Conf > - ConfDirectoryPath =3D mws.join(GenFdsGlobalVariable.WorkSpac= eDir, > 'Conf') > + if "CONF_PATH" in os.environ.keys(): > + ConfDirectoryPath =3D os.path.normcase(os.environ["CONF_= PATH"]) > + else: > + # Get standard WORKSPACE/Conf, use the absolute path to = the > WORKSPACE/Conf > + ConfDirectoryPath =3D mws.join(GenFdsGlobalVariable.Work= SpaceDir, > 'Conf') > GenFdsGlobalVariable.ConfDir =3D ConfDirectoryPath > BuildConfigurationFile =3D > os.path.normpath(os.path.join(ConfDirectoryPath, "target.txt")) > if os.path.isfile(BuildConfigurationFile) =3D=3D True: > TargetTxt =3D TargetTxtClassObject.TargetTxtClassObject() > TargetTxt.LoadTargetTxtFile(BuildConfigurationFile) > diff --git a/BaseTools/Source/Python/build/build.py > b/BaseTools/Source/Python/build/build.py > index d9afdcc..be02119 100644 > --- a/BaseTools/Source/Python/build/build.py > +++ b/BaseTools/Source/Python/build/build.py > @@ -773,12 +773,15 @@ class Build(): > if not os.path.isabs(ConfDirectoryPath): > # Since alternate directory name is not absolute, the al= ternate > directory is located within the WORKSPACE > # This also handles someone specifying the Conf director= y in the > workspace. Using --conf=3DConf > ConfDirectoryPath =3D mws.join(self.WorkspaceDir, ConfDi= rectoryPath) > else: > - # Get standard WORKSPACE/Conf use the absolute path to the > WORKSPACE/Conf > - ConfDirectoryPath =3D mws.join(self.WorkspaceDir, 'Conf') > + if "CONF_PATH" in os.environ: > + ConfDirectoryPath =3D > os.path.normcase(os.path.normpath(os.environ["CONF_PATH"])) > + else: > + # Get standard WORKSPACE/Conf use the absolute path to t= he > WORKSPACE/Conf > + ConfDirectoryPath =3D mws.join(self.WorkspaceDir, 'Conf'= ) > GlobalData.gConfDirectory =3D ConfDirectoryPath > GlobalData.gDatabasePath =3D > os.path.normpath(os.path.join(ConfDirectoryPath, > GlobalData.gDatabasePath)) >=20 > if BuildOptions.DisableCache: > self.Db =3D WorkspaceDatabase(":memory:") > @@ -810,11 +813,11 @@ class Build(): > EdkLogger.quiet("%-16s =3D %s" % ("EFI_SOURCE", > os.environ["EFI_SOURCE"])) > EdkLogger.quiet("%-16s =3D %s" % ("EDK_TOOLS_PATH", > os.environ["EDK_TOOLS_PATH"])) > if "EDK_TOOLS_BIN" in os.environ: > # Print the same path style with WORKSPACE env. > EdkLogger.quiet("%-16s =3D %s" % ("EDK_TOOLS_BIN", > os.path.normcase(os.path.normpath(os.environ["EDK_TOOLS_BIN"])))) > - > + EdkLogger.quiet("%-16s =3D %s" % ("CONF_PATH", > GlobalData.gConfDirectory)) > self.InitPreBuild() > self.InitPostBuild() > if self.PrebuildScript: > EdkLogger.quiet("%-16s =3D %s" % ("PREBUILD", self.PrebuildS= cript)) > if self.PostbuildScript: > -- > 2.6.1.windows.1 >=20 > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel