From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.93, mailfrom: liming.gao@intel.com) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by groups.io with SMTP; Sun, 21 Jul 2019 05:29:43 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Jul 2019 05:29:43 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,290,1559545200"; d="scan'208";a="196476818" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by fmsmga002.fm.intel.com with ESMTP; 21 Jul 2019 05:29:43 -0700 Received: from fmsmsx162.amr.corp.intel.com (10.18.125.71) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 21 Jul 2019 05:29:43 -0700 Received: from shsmsx154.ccr.corp.intel.com (10.239.6.54) by fmsmsx162.amr.corp.intel.com (10.18.125.71) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 21 Jul 2019 05:29:42 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.110]) by SHSMSX154.ccr.corp.intel.com ([169.254.7.240]) with mapi id 14.03.0439.000; Sun, 21 Jul 2019 20:29:41 +0800 From: "Liming Gao" To: "devel@edk2.groups.io" , "Feng, Bob C" Subject: Re: [edk2-devel] [Patch] BaseTools: Fixed the mis-using strip() function issue. Thread-Topic: [edk2-devel] [Patch] BaseTools: Fixed the mis-using strip() function issue. Thread-Index: AQHVP3gWVmy2ohcCy0u82uK5LeHwzqbVAJ3A Date: Sun, 21 Jul 2019 12:29:40 +0000 Message-ID: <4A89E2EF3DFEDB4C8BFDE51014F606A14E4ACEA4@SHSMSX104.ccr.corp.intel.com> References: <20190721035452.16704-1-bob.c.feng@intel.com> In-Reply-To: <20190721035452.16704-1-bob.c.feng@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOGE3NDg1OTYtOTExMC00MGJiLTk5ODMtODFkNmMyNWQwNzcwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiZW5ZSUpBenVJeTVCdWpYSXJIMnNUMUJRSCs0WGhFQk5SMVBMT0tVTmQ0NGp2T25vYStCSGhlZkJUUUxneUUrRiJ9 dlp-product: dlpe-windows dlp-version: 11.0.600.7 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Return-Path: liming.gao@intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Bob: > -----Original Message----- > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Bo= b Feng > Sent: Sunday, July 21, 2019 11:55 AM > To: devel@edk2.groups.io > Cc: Gao, Liming ; Feng, Bob C > Subject: [edk2-devel] [Patch] BaseTools: Fixed the mis-using strip() fun= ction issue. >=20 > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2003 >=20 > lstrip(parameter) do the match based on the char > in parameter but not only the whole parameter string. >=20 > In GenMake line 1082, > CmdSign.lstrip('/Fo') will strip the '/' or > 'F' or 'o' on the left of CmdSign. This is not expected. >=20 > This patch is going to fix such issue. >=20 > Cc: Liming Gao > Signed-off-by: Bob Feng > --- > BaseTools/Source/Python/AutoGen/GenMake.py | 2 +- > BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py | 5 ++++- > 2 files changed, 5 insertions(+), 2 deletions(-) >=20 > diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Sour= ce/Python/AutoGen/GenMake.py > index 212ca0fa7f..10e67f7dbb 100644 > --- a/BaseTools/Source/Python/AutoGen/GenMake.py > +++ b/BaseTools/Source/Python/AutoGen/GenMake.py > @@ -1077,11 +1077,11 @@ cleanlib: > CmdTargetDict[CmdSign] =3D Item.replace(Temp, C= mdSign) > else: > CmdTargetDict[CmdSign] =3D "%s %s" % (CmdTarget= Dict[CmdSign], SingleCommandList[-1]) > Index =3D CommandList.index(Item) > CommandList.pop(Index) > - if SingleCommandList[-1].endswith("%s%s.c" % (TAB_S= LASH, CmdSumDict[CmdSign.lstrip('/Fo').rsplit(TAB_SLASH, > 1)[0]])): > + if SingleCommandList[-1].endswith("%s%s.c" % (TAB_S= LASH, CmdSumDict[CmdSign[3:].rsplit(TAB_SLASH, 1)[0]])): What mean CmdSign[3:]? Is it for root directory in Windows OS? Does it sup= port the path in Linux OS? Thanks Liming > Cpplist =3D CmdCppDict[T.Target.SubDir] > Cpplist.insert(0, '$(OBJLIST_%d): $(COMMON_DEPS= )' % list(self.ObjTargetDict.keys()).index(T.Target.SubDir)) > T.Commands[Index] =3D '%s\n\t%s' % (' \\\n\t'.j= oin(Cpplist), CmdTargetDict[CmdSign]) > else: > T.Commands.pop(Index) > diff --git a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py b/Ba= seTools/Source/Python/GenFds/GenFdsGlobalVariable.py > index c9c476cf61..f43743dff4 100644 > --- a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py > +++ b/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py > @@ -791,11 +791,14 @@ class GenFdsGlobalVariable: > # > @staticmethod > def GetPcdValue (PcdPattern): > if PcdPattern is None: > return None > - PcdPair =3D PcdPattern.lstrip('PCD(').rstrip(')').strip().split= ('.') > + if PcdPattern.startswith('PCD('): > + PcdPair =3D PcdPattern[4:].rstrip(')').strip().split('.') > + else: > + PcdPair =3D PcdPattern.strip().split('.') > TokenSpace =3D PcdPair[0] > TokenCName =3D PcdPair[1] >=20 > for Arch in GenFdsGlobalVariable.ArchList: > Platform =3D GenFdsGlobalVariable.WorkSpace.BuildObject[Gen= FdsGlobalVariable.ActivePlatform, Arch, > GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag] > -- > 2.18.0.windows.1 >=20 >=20 >=20