BaseTools:"--exclude" don't apply if parameter ends with separator
BZ:https://bugzilla.tianocore.org/show_bug.cgi?id=1944 FormatDosFiles.py Intel\ServerSiliconPkg --exclude Library\SimRegisters\ Its parameter "Library\SimRegisters\" ends with '\' but I can't seem to get it to exclude the SimRegisters directory This patch is going to fix this issue Cc: Liming Gao <liming.gao@intel.com> Cc: Bob Feng <bob.c.feng@intel.com> Signed-off-by: Zhiju.Fan <zhijux.fan@intel.com>
This commit is contained in:
@ -53,6 +53,7 @@ def FormatFilesInDir(DirPath, ExtList, Args):
|
|||||||
FileNames[:] = [f for f in FileNames if f not in Args.Exclude]
|
FileNames[:] = [f for f in FileNames if f not in Args.Exclude]
|
||||||
Continue = False
|
Continue = False
|
||||||
for Path in Args.Exclude:
|
for Path in Args.Exclude:
|
||||||
|
Path = Path.strip('\\').strip('/')
|
||||||
if not os.path.isdir(Path) and not os.path.isfile(Path):
|
if not os.path.isdir(Path) and not os.path.isfile(Path):
|
||||||
Path = os.path.join(ExcludeDir, Path)
|
Path = os.path.join(ExcludeDir, Path)
|
||||||
if os.path.isdir(Path) and Path.endswith(DirPath):
|
if os.path.isdir(Path) and Path.endswith(DirPath):
|
||||||
|
Reference in New Issue
Block a user