]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools:"--exclude" don't apply if parameter ends with separator
authorFan, ZhijuX <zhijux.fan@intel.com>
Thu, 19 Sep 2019 07:45:28 +0000 (15:45 +0800)
committerLiming Gao <liming.gao@intel.com>
Fri, 27 Sep 2019 00:17:55 +0000 (08:17 +0800)
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>
BaseTools/Scripts/FormatDosFiles.py

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