Matthew, Would os.path.<something> (maybe splitext) be a better function than using the string rsplit function? It just seems like we should use the python file path manipulation functions instead of trying to trick the string manipulation routines into the same behavior...
-Jaben > -----Original Message----- > From: edk2-devel [mailto:edk2-devel-boun...@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 <yeaz...@amazon.com> > 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 <yeaz...@amazon.com> > --- > 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.BuildRuleOrder > and > SingleFile.Ext in self.BuildRules: > - key = SingleFile.Path.split(SingleFile.Ext)[0] > + key = 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