]> git.proxmox.com Git - mirror_edk2.git/commitdiff
BaseTools: Clean the ffs folder before generating files in it
authorBob Feng <bob.c.feng@intel.com>
Wed, 23 Sep 2020 11:21:04 +0000 (19:21 +0800)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Fri, 25 Sep 2020 02:27:35 +0000 (02:27 +0000)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2965

The content in Guid.xref depends on the files under the corresponding
ffs folder.(refer to the commit 5e9256cd7f54ffd6f1fd9837df92a911fcd2d7c2)
To make Guid.xref update in the incremental build,
clean the files under that ffs folder before generating files in it.

Signed-off-by: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>
Reviewed-by: Yuwei Chen<yuwei.chen@intel.com>
BaseTools/Source/Python/GenFds/FfsFileStatement.py

index 9fb62b0a9143a0022ba04370b7fc35a536aa6723..1c6e59bac75c9e05788bc9bbb1828510f68f8b1c 100644 (file)
@@ -21,6 +21,7 @@ from .GuidSection import GuidSection
 from .FvImageSection import FvImageSection\r
 from .Ffs import FdfFvFileTypeToFileType\r
 from .GenFdsGlobalVariable import GenFdsGlobalVariable\r
+import shutil\r
 \r
 ## generate FFS from FILE\r
 #\r
@@ -67,6 +68,8 @@ class FileStatement (FileStatementClassObject):
         if FvName:\r
             Str += FvName\r
         OutputDir = os.path.join(GenFdsGlobalVariable.FfsDir, Str)\r
+        if os.path.exists(OutputDir):\r
+            shutil.rmtree(OutputDir)\r
         if not os.path.exists(OutputDir):\r
             os.makedirs(OutputDir)\r
 \r