Pārlūkot izejas kodu

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>
Fan, ZhijuX 4 gadi atpakaļ
vecāks
revīzija
6da405ebf6
1 mainītis faili ar 1 papildinājumiem un 0 dzēšanām
  1. 1 0
      BaseTools/Scripts/FormatDosFiles.py

+ 1 - 0
BaseTools/Scripts/FormatDosFiles.py

@@ -53,6 +53,7 @@ def FormatFilesInDir(DirPath, ExtList, Args):
             FileNames[:] = [f for f in FileNames if f not in Args.Exclude]
             Continue = False
             for Path in Args.Exclude:
+                Path = Path.strip('\\').strip('/')
                 if not os.path.isdir(Path) and not os.path.isfile(Path):
                     Path = os.path.join(ExcludeDir, Path)
                 if os.path.isdir(Path) and Path.endswith(DirPath):