BaseTools: Clean the ffs folder before generating files in it

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 5e9256cd7f)
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>
This commit is contained in:
Bob Feng 2020-09-23 19:21:04 +08:00 committed by mergify[bot]
parent aec99d9bc3
commit a8c77eba37
1 changed files with 3 additions and 0 deletions

View File

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