From bcbdc75535d376d710cd864fb3cf5129c7dfcaff Mon Sep 17 00:00:00 2001 From: Yingke Liu Date: Wed, 12 Nov 2014 08:26:03 +0000 Subject: [PATCH] BaseTools: Fix a cleanall issue. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yingke Liu Reviewed-by: Liming Gao git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16338 6f19259b-4bc3-4df7-8a09-765794883524 --- BaseTools/Source/Python/build/build.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py index e9baf3465e..7d68b45417 100644 --- a/BaseTools/Source/Python/build/build.py +++ b/BaseTools/Source/Python/build/build.py @@ -997,11 +997,6 @@ class Build(): try: #os.rmdir(AutoGenObject.BuildDir) RemoveDirectory(AutoGenObject.BuildDir, True) - # - # First should close DB. - # - self.Db.Close() - RemoveDirectory(os.path.dirname(GlobalData.gDatabasePath), True) except WindowsError, X: EdkLogger.error("build", FILE_DELETE_FAILURE, ExtraData=str(X)) return True @@ -1091,11 +1086,6 @@ class Build(): try: #os.rmdir(AutoGenObject.BuildDir) RemoveDirectory(AutoGenObject.BuildDir, True) - # - # First should close DB. - # - self.Db.Close() - RemoveDirectory(os.path.dirname(GlobalData.gDatabasePath), True) except WindowsError, X: EdkLogger.error("build", FILE_DELETE_FAILURE, ExtraData=str(X)) return True @@ -1805,6 +1795,10 @@ class Build(): self.SpawnMode = False self._BuildModule() + if self.Target == 'cleanall': + self.Db.Close() + RemoveDirectory(os.path.dirname(GlobalData.gDatabasePath), True) + def CreateAsBuiltInf(self): for Module in self.BuildModules: Module.CreateAsBuiltInf()