public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] BaseTools: Fixed the mis-using strip() function issue.
@ 2019-07-21  3:54 Bob Feng
  2019-07-21 12:29 ` [edk2-devel] " Liming Gao
  0 siblings, 1 reply; 5+ messages in thread
From: Bob Feng @ 2019-07-21  3:54 UTC (permalink / raw)
  To: devel; +Cc: Liming Gao, Bob Feng

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2003

lstrip(parameter) do the match based on the char
in parameter but not only the whole parameter string.

In GenMake line 1082,
CmdSign.lstrip('/Fo') will strip the '/' or
'F' or 'o' on the left of CmdSign. This is not expected.

This patch is going to fix such issue.

Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Bob Feng <bob.c.feng@intel.com>
---
 BaseTools/Source/Python/AutoGen/GenMake.py             | 2 +-
 BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/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] = Item.replace(Temp, CmdSign)
                     else:
                         CmdTargetDict[CmdSign] = "%s %s" % (CmdTargetDict[CmdSign], SingleCommandList[-1])
                     Index = CommandList.index(Item)
                     CommandList.pop(Index)
-                    if SingleCommandList[-1].endswith("%s%s.c" % (TAB_SLASH, CmdSumDict[CmdSign.lstrip('/Fo').rsplit(TAB_SLASH, 1)[0]])):
+                    if SingleCommandList[-1].endswith("%s%s.c" % (TAB_SLASH, CmdSumDict[CmdSign[3:].rsplit(TAB_SLASH, 1)[0]])):
                         Cpplist = CmdCppDict[T.Target.SubDir]
                         Cpplist.insert(0, '$(OBJLIST_%d): $(COMMON_DEPS)' % list(self.ObjTargetDict.keys()).index(T.Target.SubDir))
                         T.Commands[Index] = '%s\n\t%s' % (' \\\n\t'.join(Cpplist), CmdTargetDict[CmdSign])
                     else:
                         T.Commands.pop(Index)
diff --git a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py b/BaseTools/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 = PcdPattern.lstrip('PCD(').rstrip(')').strip().split('.')
+        if PcdPattern.startswith('PCD('):
+            PcdPair = PcdPattern[4:].rstrip(')').strip().split('.')
+        else:
+            PcdPair = PcdPattern.strip().split('.')
         TokenSpace = PcdPair[0]
         TokenCName = PcdPair[1]
 
         for Arch in GenFdsGlobalVariable.ArchList:
             Platform = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, Arch, GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
-- 
2.18.0.windows.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [edk2-devel] [Patch] BaseTools: Fixed the mis-using strip() function issue.
  2019-07-21  3:54 [Patch] BaseTools: Fixed the mis-using strip() function issue Bob Feng
@ 2019-07-21 12:29 ` Liming Gao
  2019-07-22  0:47   ` Bob Feng
  0 siblings, 1 reply; 5+ messages in thread
From: Liming Gao @ 2019-07-21 12:29 UTC (permalink / raw)
  To: devel@edk2.groups.io, Feng, Bob C

Bob:

> -----Original Message-----
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of Bob Feng
> Sent: Sunday, July 21, 2019 11:55 AM
> To: devel@edk2.groups.io
> Cc: Gao, Liming <liming.gao@intel.com>; Feng, Bob C <bob.c.feng@intel.com>
> Subject: [edk2-devel] [Patch] BaseTools: Fixed the mis-using strip() function issue.
> 
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2003
> 
> lstrip(parameter) do the match based on the char
> in parameter but not only the whole parameter string.
> 
> In GenMake line 1082,
> CmdSign.lstrip('/Fo') will strip the '/' or
> 'F' or 'o' on the left of CmdSign. This is not expected.
> 
> This patch is going to fix such issue.
> 
> Cc: Liming Gao <liming.gao@intel.com>
> Signed-off-by: Bob Feng <bob.c.feng@intel.com>
> ---
>  BaseTools/Source/Python/AutoGen/GenMake.py             | 2 +-
>  BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py | 5 ++++-
>  2 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py b/BaseTools/Source/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] = Item.replace(Temp, CmdSign)
>                      else:
>                          CmdTargetDict[CmdSign] = "%s %s" % (CmdTargetDict[CmdSign], SingleCommandList[-1])
>                      Index = CommandList.index(Item)
>                      CommandList.pop(Index)
> -                    if SingleCommandList[-1].endswith("%s%s.c" % (TAB_SLASH, CmdSumDict[CmdSign.lstrip('/Fo').rsplit(TAB_SLASH,
> 1)[0]])):
> +                    if SingleCommandList[-1].endswith("%s%s.c" % (TAB_SLASH, CmdSumDict[CmdSign[3:].rsplit(TAB_SLASH, 1)[0]])):

What mean CmdSign[3:]? Is it for root directory in Windows OS? Does it support the path in Linux OS?

Thanks
Liming

>                          Cpplist = CmdCppDict[T.Target.SubDir]
>                          Cpplist.insert(0, '$(OBJLIST_%d): $(COMMON_DEPS)' % list(self.ObjTargetDict.keys()).index(T.Target.SubDir))
>                          T.Commands[Index] = '%s\n\t%s' % (' \\\n\t'.join(Cpplist), CmdTargetDict[CmdSign])
>                      else:
>                          T.Commands.pop(Index)
> diff --git a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py b/BaseTools/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 = PcdPattern.lstrip('PCD(').rstrip(')').strip().split('.')
> +        if PcdPattern.startswith('PCD('):
> +            PcdPair = PcdPattern[4:].rstrip(')').strip().split('.')
> +        else:
> +            PcdPair = PcdPattern.strip().split('.')
>          TokenSpace = PcdPair[0]
>          TokenCName = PcdPair[1]
> 
>          for Arch in GenFdsGlobalVariable.ArchList:
>              Platform = GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.ActivePlatform, Arch,
> GenFdsGlobalVariable.TargetName, GenFdsGlobalVariable.ToolChainTag]
> --
> 2.18.0.windows.1
> 
> 
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [edk2-devel] [Patch] BaseTools: Fixed the mis-using strip() function issue.
  2019-07-21 12:29 ` [edk2-devel] " Liming Gao
@ 2019-07-22  0:47   ` Bob Feng
  2019-07-22  3:42     ` Liming Gao
  0 siblings, 1 reply; 5+ messages in thread
From: Bob Feng @ 2019-07-22  0:47 UTC (permalink / raw)
  To: Gao, Liming, devel@edk2.groups.io

Liming,

CmdSign[3:] means to get the CmdSign sub string from the 4th character to it end. The former code can make sure CmdSign starts with "/Fo", CmdSign[3:] is just to remove "/Fo".

The issue in this case is that the CmdSign is like "/FoF://abc//cde", and CmdSign.lstrip("/Fo") removes "/FoF". 

Thanks,
Bob

-----Original Message-----
From: Gao, Liming 
Sent: Sunday, July 21, 2019 8:30 PM
To: devel@edk2.groups.io; Feng, Bob C <bob.c.feng@intel.com>
Subject: RE: [edk2-devel] [Patch] BaseTools: Fixed the mis-using strip() function issue.

Bob:

> -----Original Message-----
> From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of 
> Bob Feng
> Sent: Sunday, July 21, 2019 11:55 AM
> To: devel@edk2.groups.io
> Cc: Gao, Liming <liming.gao@intel.com>; Feng, Bob C 
> <bob.c.feng@intel.com>
> Subject: [edk2-devel] [Patch] BaseTools: Fixed the mis-using strip() function issue.
> 
> BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2003
> 
> lstrip(parameter) do the match based on the char in parameter but not 
> only the whole parameter string.
> 
> In GenMake line 1082,
> CmdSign.lstrip('/Fo') will strip the '/' or 'F' or 'o' on the left of 
> CmdSign. This is not expected.
> 
> This patch is going to fix such issue.
> 
> Cc: Liming Gao <liming.gao@intel.com>
> Signed-off-by: Bob Feng <bob.c.feng@intel.com>
> ---
>  BaseTools/Source/Python/AutoGen/GenMake.py             | 2 +-
>  BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py | 5 ++++-
>  2 files changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py 
> b/BaseTools/Source/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] = Item.replace(Temp, CmdSign)
>                      else:
>                          CmdTargetDict[CmdSign] = "%s %s" % (CmdTargetDict[CmdSign], SingleCommandList[-1])
>                      Index = CommandList.index(Item)
>                      CommandList.pop(Index)
> -                    if SingleCommandList[-1].endswith("%s%s.c" % (TAB_SLASH, CmdSumDict[CmdSign.lstrip('/Fo').rsplit(TAB_SLASH,
> 1)[0]])):
> +                    if SingleCommandList[-1].endswith("%s%s.c" % (TAB_SLASH, CmdSumDict[CmdSign[3:].rsplit(TAB_SLASH, 1)[0]])):

What mean CmdSign[3:]? Is it for root directory in Windows OS? Does it support the path in Linux OS?

Thanks
Liming

>                          Cpplist = CmdCppDict[T.Target.SubDir]
>                          Cpplist.insert(0, '$(OBJLIST_%d): $(COMMON_DEPS)' % list(self.ObjTargetDict.keys()).index(T.Target.SubDir))
>                          T.Commands[Index] = '%s\n\t%s' % (' \\\n\t'.join(Cpplist), CmdTargetDict[CmdSign])
>                      else:
>                          T.Commands.pop(Index) diff --git 
> a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py 
> b/BaseTools/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 = PcdPattern.lstrip('PCD(').rstrip(')').strip().split('.')
> +        if PcdPattern.startswith('PCD('):
> +            PcdPair = PcdPattern[4:].rstrip(')').strip().split('.')
> +        else:
> +            PcdPair = PcdPattern.strip().split('.')
>          TokenSpace = PcdPair[0]
>          TokenCName = PcdPair[1]
> 
>          for Arch in GenFdsGlobalVariable.ArchList:
>              Platform = 
> GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.Active
> Platform, Arch, GenFdsGlobalVariable.TargetName, 
> GenFdsGlobalVariable.ToolChainTag]
> --
> 2.18.0.windows.1
> 
> 
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [edk2-devel] [Patch] BaseTools: Fixed the mis-using strip() function issue.
  2019-07-22  0:47   ` Bob Feng
@ 2019-07-22  3:42     ` Liming Gao
  2019-07-22  4:07       ` Bob Feng
  0 siblings, 1 reply; 5+ messages in thread
From: Liming Gao @ 2019-07-22  3:42 UTC (permalink / raw)
  To: Feng, Bob C, devel@edk2.groups.io

Ok. Make sense. 

Reviewed-by: Liming Gao <liming.gao@intel.com>

> -----Original Message-----
> From: Feng, Bob C
> Sent: Monday, July 22, 2019 8:48 AM
> To: Gao, Liming <liming.gao@intel.com>; devel@edk2.groups.io
> Subject: RE: [edk2-devel] [Patch] BaseTools: Fixed the mis-using strip() function issue.
> 
> Liming,
> 
> CmdSign[3:] means to get the CmdSign sub string from the 4th character to it end. The former code can make sure CmdSign starts with
> "/Fo", CmdSign[3:] is just to remove "/Fo".
> 
> The issue in this case is that the CmdSign is like "/FoF://abc//cde", and CmdSign.lstrip("/Fo") removes "/FoF".
> 
> Thanks,
> Bob
> 
> -----Original Message-----
> From: Gao, Liming
> Sent: Sunday, July 21, 2019 8:30 PM
> To: devel@edk2.groups.io; Feng, Bob C <bob.c.feng@intel.com>
> Subject: RE: [edk2-devel] [Patch] BaseTools: Fixed the mis-using strip() function issue.
> 
> Bob:
> 
> > -----Original Message-----
> > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of
> > Bob Feng
> > Sent: Sunday, July 21, 2019 11:55 AM
> > To: devel@edk2.groups.io
> > Cc: Gao, Liming <liming.gao@intel.com>; Feng, Bob C
> > <bob.c.feng@intel.com>
> > Subject: [edk2-devel] [Patch] BaseTools: Fixed the mis-using strip() function issue.
> >
> > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2003
> >
> > lstrip(parameter) do the match based on the char in parameter but not
> > only the whole parameter string.
> >
> > In GenMake line 1082,
> > CmdSign.lstrip('/Fo') will strip the '/' or 'F' or 'o' on the left of
> > CmdSign. This is not expected.
> >
> > This patch is going to fix such issue.
> >
> > Cc: Liming Gao <liming.gao@intel.com>
> > Signed-off-by: Bob Feng <bob.c.feng@intel.com>
> > ---
> >  BaseTools/Source/Python/AutoGen/GenMake.py             | 2 +-
> >  BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py | 5 ++++-
> >  2 files changed, 5 insertions(+), 2 deletions(-)
> >
> > diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py
> > b/BaseTools/Source/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] = Item.replace(Temp, CmdSign)
> >                      else:
> >                          CmdTargetDict[CmdSign] = "%s %s" % (CmdTargetDict[CmdSign], SingleCommandList[-1])
> >                      Index = CommandList.index(Item)
> >                      CommandList.pop(Index)
> > -                    if SingleCommandList[-1].endswith("%s%s.c" % (TAB_SLASH, CmdSumDict[CmdSign.lstrip('/Fo').rsplit(TAB_SLASH,
> > 1)[0]])):
> > +                    if SingleCommandList[-1].endswith("%s%s.c" % (TAB_SLASH, CmdSumDict[CmdSign[3:].rsplit(TAB_SLASH,
> 1)[0]])):
> 
> What mean CmdSign[3:]? Is it for root directory in Windows OS? Does it support the path in Linux OS?
> 
> Thanks
> Liming
> 
> >                          Cpplist = CmdCppDict[T.Target.SubDir]
> >                          Cpplist.insert(0, '$(OBJLIST_%d): $(COMMON_DEPS)' % list(self.ObjTargetDict.keys()).index(T.Target.SubDir))
> >                          T.Commands[Index] = '%s\n\t%s' % (' \\\n\t'.join(Cpplist), CmdTargetDict[CmdSign])
> >                      else:
> >                          T.Commands.pop(Index) diff --git
> > a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
> > b/BaseTools/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 = PcdPattern.lstrip('PCD(').rstrip(')').strip().split('.')
> > +        if PcdPattern.startswith('PCD('):
> > +            PcdPair = PcdPattern[4:].rstrip(')').strip().split('.')
> > +        else:
> > +            PcdPair = PcdPattern.strip().split('.')
> >          TokenSpace = PcdPair[0]
> >          TokenCName = PcdPair[1]
> >
> >          for Arch in GenFdsGlobalVariable.ArchList:
> >              Platform =
> > GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.Active
> > Platform, Arch, GenFdsGlobalVariable.TargetName,
> > GenFdsGlobalVariable.ToolChainTag]
> > --
> > 2.18.0.windows.1
> >
> >
> > 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [edk2-devel] [Patch] BaseTools: Fixed the mis-using strip() function issue.
  2019-07-22  3:42     ` Liming Gao
@ 2019-07-22  4:07       ` Bob Feng
  0 siblings, 0 replies; 5+ messages in thread
From: Bob Feng @ 2019-07-22  4:07 UTC (permalink / raw)
  To: Gao, Liming, devel@edk2.groups.io, Chan, Amy

Thanks.

Pushed. SHA-1: bb824f685d760f560bb3c3fb14af394ab3b3544f

Thanks,
Bob

-----Original Message-----
From: Gao, Liming 
Sent: Monday, July 22, 2019 11:43 AM
To: Feng, Bob C <bob.c.feng@intel.com>; devel@edk2.groups.io
Subject: RE: [edk2-devel] [Patch] BaseTools: Fixed the mis-using strip() function issue.

Ok. Make sense. 

Reviewed-by: Liming Gao <liming.gao@intel.com>

> -----Original Message-----
> From: Feng, Bob C
> Sent: Monday, July 22, 2019 8:48 AM
> To: Gao, Liming <liming.gao@intel.com>; devel@edk2.groups.io
> Subject: RE: [edk2-devel] [Patch] BaseTools: Fixed the mis-using strip() function issue.
> 
> Liming,
> 
> CmdSign[3:] means to get the CmdSign sub string from the 4th character 
> to it end. The former code can make sure CmdSign starts with "/Fo", CmdSign[3:] is just to remove "/Fo".
> 
> The issue in this case is that the CmdSign is like "/FoF://abc//cde", and CmdSign.lstrip("/Fo") removes "/FoF".
> 
> Thanks,
> Bob
> 
> -----Original Message-----
> From: Gao, Liming
> Sent: Sunday, July 21, 2019 8:30 PM
> To: devel@edk2.groups.io; Feng, Bob C <bob.c.feng@intel.com>
> Subject: RE: [edk2-devel] [Patch] BaseTools: Fixed the mis-using strip() function issue.
> 
> Bob:
> 
> > -----Original Message-----
> > From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf 
> > Of Bob Feng
> > Sent: Sunday, July 21, 2019 11:55 AM
> > To: devel@edk2.groups.io
> > Cc: Gao, Liming <liming.gao@intel.com>; Feng, Bob C 
> > <bob.c.feng@intel.com>
> > Subject: [edk2-devel] [Patch] BaseTools: Fixed the mis-using strip() function issue.
> >
> > BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2003
> >
> > lstrip(parameter) do the match based on the char in parameter but 
> > not only the whole parameter string.
> >
> > In GenMake line 1082,
> > CmdSign.lstrip('/Fo') will strip the '/' or 'F' or 'o' on the left 
> > of CmdSign. This is not expected.
> >
> > This patch is going to fix such issue.
> >
> > Cc: Liming Gao <liming.gao@intel.com>
> > Signed-off-by: Bob Feng <bob.c.feng@intel.com>
> > ---
> >  BaseTools/Source/Python/AutoGen/GenMake.py             | 2 +-
> >  BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py | 5 ++++-
> >  2 files changed, 5 insertions(+), 2 deletions(-)
> >
> > diff --git a/BaseTools/Source/Python/AutoGen/GenMake.py
> > b/BaseTools/Source/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] = Item.replace(Temp, CmdSign)
> >                      else:
> >                          CmdTargetDict[CmdSign] = "%s %s" % (CmdTargetDict[CmdSign], SingleCommandList[-1])
> >                      Index = CommandList.index(Item)
> >                      CommandList.pop(Index)
> > -                    if SingleCommandList[-1].endswith("%s%s.c" % (TAB_SLASH, CmdSumDict[CmdSign.lstrip('/Fo').rsplit(TAB_SLASH,
> > 1)[0]])):
> > +                    if SingleCommandList[-1].endswith("%s%s.c" % 
> > + (TAB_SLASH, CmdSumDict[CmdSign[3:].rsplit(TAB_SLASH,
> 1)[0]])):
> 
> What mean CmdSign[3:]? Is it for root directory in Windows OS? Does it support the path in Linux OS?
> 
> Thanks
> Liming
> 
> >                          Cpplist = CmdCppDict[T.Target.SubDir]
> >                          Cpplist.insert(0, '$(OBJLIST_%d): $(COMMON_DEPS)' % list(self.ObjTargetDict.keys()).index(T.Target.SubDir))
> >                          T.Commands[Index] = '%s\n\t%s' % (' \\\n\t'.join(Cpplist), CmdTargetDict[CmdSign])
> >                      else:
> >                          T.Commands.pop(Index) diff --git 
> > a/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
> > b/BaseTools/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 = PcdPattern.lstrip('PCD(').rstrip(')').strip().split('.')
> > +        if PcdPattern.startswith('PCD('):
> > +            PcdPair = PcdPattern[4:].rstrip(')').strip().split('.')
> > +        else:
> > +            PcdPair = PcdPattern.strip().split('.')
> >          TokenSpace = PcdPair[0]
> >          TokenCName = PcdPair[1]
> >
> >          for Arch in GenFdsGlobalVariable.ArchList:
> >              Platform =
> > GenFdsGlobalVariable.WorkSpace.BuildObject[GenFdsGlobalVariable.Acti
> > ve Platform, Arch, GenFdsGlobalVariable.TargetName, 
> > GenFdsGlobalVariable.ToolChainTag]
> > --
> > 2.18.0.windows.1
> >
> >
> > 


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-07-22  4:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-21  3:54 [Patch] BaseTools: Fixed the mis-using strip() function issue Bob Feng
2019-07-21 12:29 ` [edk2-devel] " Liming Gao
2019-07-22  0:47   ` Bob Feng
2019-07-22  3:42     ` Liming Gao
2019-07-22  4:07       ` Bob Feng

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox