public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch] BaseTools: Clean the ffs folder before generating files in it
@ 2020-09-23 11:21 Bob Feng
  2020-09-25  1:58 ` [edk2-devel] " Yuwei Chen
  0 siblings, 1 reply; 2+ messages in thread
From: Bob Feng @ 2020-09-23 11:21 UTC (permalink / raw)
  To: devel; +Cc: Liming Gao, Yuwei Chen

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>
---
 BaseTools/Source/Python/GenFds/FfsFileStatement.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/BaseTools/Source/Python/GenFds/FfsFileStatement.py b/BaseTools/Source/Python/GenFds/FfsFileStatement.py
index 9fb62b0a91..1c6e59bac7 100644
--- a/BaseTools/Source/Python/GenFds/FfsFileStatement.py
+++ b/BaseTools/Source/Python/GenFds/FfsFileStatement.py
@@ -19,10 +19,11 @@ from Common.Misc import GuidStructureByteArrayToGuidString, SaveFileOnChange
 import Common.LongFilePathOs as os
 from .GuidSection import GuidSection
 from .FvImageSection import FvImageSection
 from .Ffs import FdfFvFileTypeToFileType
 from .GenFdsGlobalVariable import GenFdsGlobalVariable
+import shutil
 
 ## generate FFS from FILE
 #
 #
 class FileStatement (FileStatementClassObject):
@@ -65,10 +66,12 @@ class FileStatement (FileStatementClassObject):
 
         Str = self.NameGuid
         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)
 
         if Dict is None:
             Dict = {}
-- 
2.20.1.windows.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [edk2-devel] [Patch] BaseTools: Clean the ffs folder before generating files in it
  2020-09-23 11:21 [Patch] BaseTools: Clean the ffs folder before generating files in it Bob Feng
@ 2020-09-25  1:58 ` Yuwei Chen
  0 siblings, 0 replies; 2+ messages in thread
From: Yuwei Chen @ 2020-09-25  1:58 UTC (permalink / raw)
  To: devel@edk2.groups.io, Feng, Bob C; +Cc: Liming Gao

Reviewed-by: Yuwei Chen<yuwei.chen@intel.com>

> -----Original Message-----
> From: devel@edk2.groups.io <devel@edk2.groups.io> On Behalf Of Bob
> Feng
> Sent: Wednesday, September 23, 2020 7:21 PM
> To: devel@edk2.groups.io
> Cc: Liming Gao <gaoliming@byosoft.com.cn>; Chen, Christine
> <yuwei.chen@intel.com>
> Subject: [edk2-devel] [Patch] 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 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>
> ---
>  BaseTools/Source/Python/GenFds/FfsFileStatement.py | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/BaseTools/Source/Python/GenFds/FfsFileStatement.py
> b/BaseTools/Source/Python/GenFds/FfsFileStatement.py
> index 9fb62b0a91..1c6e59bac7 100644
> --- a/BaseTools/Source/Python/GenFds/FfsFileStatement.py
> +++ b/BaseTools/Source/Python/GenFds/FfsFileStatement.py
> @@ -19,10 +19,11 @@ from Common.Misc import
> GuidStructureByteArrayToGuidString, SaveFileOnChange  import
> Common.LongFilePathOs as os  from .GuidSection import GuidSection
> from .FvImageSection import FvImageSection  from .Ffs import
> FdfFvFileTypeToFileType  from .GenFdsGlobalVariable import
> GenFdsGlobalVariable
> +import shutil
> 
>  ## generate FFS from FILE
>  #
>  #
>  class FileStatement (FileStatementClassObject):
> @@ -65,10 +66,12 @@ class FileStatement (FileStatementClassObject):
> 
>          Str = self.NameGuid
>          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)
> 
>          if Dict is None:
>              Dict = {}
> --
> 2.20.1.windows.1
> 
> 
> 
> 
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-25  1:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-23 11:21 [Patch] BaseTools: Clean the ffs folder before generating files in it Bob Feng
2020-09-25  1:58 ` [edk2-devel] " Yuwei Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox