From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.31; helo=mga06.intel.com; envelope-from=jaben.carsey@intel.com; receiver=edk2-devel@lists.01.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (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 DD6592194D3AE for ; Fri, 5 Oct 2018 13:24:12 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Oct 2018 13:24:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,346,1534834800"; d="scan'208";a="263246858" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga005.jf.intel.com with ESMTP; 05 Oct 2018 13:20:20 -0700 Received: from fmsmsx117.amr.corp.intel.com (10.18.116.17) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.319.2; Fri, 5 Oct 2018 13:20:20 -0700 Received: from fmsmsx103.amr.corp.intel.com ([169.254.2.16]) by fmsmsx117.amr.corp.intel.com ([169.254.3.34]) with mapi id 14.03.0319.002; Fri, 5 Oct 2018 13:20:20 -0700 From: "Carsey, Jaben" To: "Yeazel (Prime Air), Matt" , "edk2-devel@lists.01.org" Thread-Topic: [edk2] [PATCH] BaseTools: Add support for dots in paths Thread-Index: AQHUXM8Rr0oJ22191Uy1Z0YGiCRsT6UQ82fwgACWbwD//439IA== Date: Fri, 5 Oct 2018 20:20:19 +0000 Message-ID: References: <38601194f721dcbf6c2b10c981e25714c073a854.1538756540.git.yeazelm@amazon.com>, <1538770053707.32060@amazon.com> In-Reply-To: <1538770053707.32060@amazon.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiNzU1YmIxNzItMTA3ZS00NzQwLWI5MzYtNmVkZWNlMDcyNjkzIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiWTl6OEJoc1ZxYU1pdjB6bzBYVDZnS0JzejU0XC9XTVdaVFBSQ2NsUVR2T0xyd09reDRsdVhYYTNLcmo5UkxGRisifQ== x-ctpclassification: CTP_NT dlp-product: dlpe-windows dlp-version: 11.0.400.15 dlp-reaction: no-action x-originating-ip: [10.1.200.107] MIME-Version: 1.0 Subject: Re: [PATCH] BaseTools: Add support for dots in paths X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Oct 2018 20:24:13 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I think that would be better since we are manipulating a path. I think tha= t file needs lots of rework, but I also know that Bob Feng (added to CC) is= working on that file recently and he might want to think on using os.path = to replace lots of stuff. > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > Yeazel (Prime Air), Matt > Sent: Friday, October 05, 2018 1:08 PM > To: Carsey, Jaben ; edk2-devel@lists.01.org > Subject: Re: [edk2] [PATCH] BaseTools: Add support for dots in paths > Importance: High >=20 > splitext is probably the exact function we want. I noticed os.path is use= d > extensively through this file but not in this case and was concerned ther= e > was a reason behind using SingleFile.Ext to split so I chose to change it= as > minimally as possible to avoid unintended side effects. I can switch to u= sing > os.path.splitext as well if that would be more desired. >=20 > Matthew > ________________________________________ > From: Carsey, Jaben > Sent: Friday, October 5, 2018 11:13 AM > To: Yeazel (Prime Air), Matt; edk2-devel@lists.01.org > Subject: RE: [edk2] [PATCH] BaseTools: Add support for dots in paths >=20 > Matthew, >=20 > Would os.path. (maybe splitext) be a better function than usin= g > the string rsplit function? It just seems like we should use the python= file > path manipulation functions instead of trying to trick the string manipul= ation > routines into the same behavior... >=20 > -Jaben >=20 > > -----Original Message----- > > From: edk2-devel [mailto:edk2-devel-bounces@lists.01.org] On Behalf Of > > Matthew Yeazel > > Sent: Friday, October 05, 2018 10:13 AM > > To: edk2-devel@lists.01.org > > Cc: Matthew Yeazel > > Subject: [edk2] [PATCH] BaseTools: Add support for dots in paths > > > > The split assumes that there isn't a dot in the path to the file but > > this isn't always the case. This will support more diverse paths. > > > > Contributed-under: TianoCore Contribution Agreement 1.1 > > Note: Section 3, paragraph 1, is read as an OR. > > Signed-off-by: Matthew Yeazel > > --- > > BaseTools/Source/Python/AutoGen/AutoGen.py | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/BaseTools/Source/Python/AutoGen/AutoGen.py > > b/BaseTools/Source/Python/AutoGen/AutoGen.py > > index eb1b283889..54ad4a5247 100644 > > --- a/BaseTools/Source/Python/AutoGen/AutoGen.py > > +++ b/BaseTools/Source/Python/AutoGen/AutoGen.py > > @@ -3062,7 +3062,7 @@ class ModuleAutoGen(AutoGen): > > self.BuildOption > > for SingleFile in FileList: > > if self.BuildRuleOrder and SingleFile.Ext in self.BuildRul= eOrder and > > SingleFile.Ext in self.BuildRules: > > - key =3D SingleFile.Path.split(SingleFile.Ext)[0] > > + key =3D SingleFile.Path.rsplit(SingleFile.Ext, 1)[0] > > if key in Order_Dict: > > Order_Dict[key].append(SingleFile.Ext) > > else: > > -- > > 2.19.0 > > > > _______________________________________________ > > edk2-devel mailing list > > edk2-devel@lists.01.org > > https://lists.01.org/mailman/listinfo/edk2-devel > _______________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel