Removed existing file before copy which would speed up the file copy a little bit
authorjwang36 <jwang36@7335b38e-4728-0410-8992-fb3ffe349368>
Thu, 28 Feb 2008 12:52:37 +0000 (12:52 +0000)
committerjwang36 <jwang36@7335b38e-4728-0410-8992-fb3ffe349368>
Thu, 28 Feb 2008 12:52:37 +0000 (12:52 +0000)
git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@1032 7335b38e-4728-0410-8992-fb3ffe349368

Source/Python/GenFds/DataSection.py
Source/Python/GenFds/EfiSection.py
Source/Python/GenFds/FfsInfStatement.py

index 0e5f5a5..148486d 100644 (file)
@@ -73,6 +73,8 @@ class DataSection (DataSectionClassObject):
             MapFile = Filename.replace('.efi', '.map')\r
             if os.path.exists(MapFile):\r
                 CopyMapFile = os.path.join(OutputPath, ModuleName + '.map')\r
+                if os.path.exists(CopyMapFile):\r
+                    os.remove(CopyMapFile)\r
                 shutil.copyfile(MapFile, CopyMapFile) \r
         \r
         NoStrip = True\r
@@ -82,6 +84,8 @@ class DataSection (DataSectionClassObject):
         \r
         if not NoStrip:\r
             FileBeforeStrip = os.path.join(OutputPath, ModuleName + '.efi')\r
+            if os.path.exists(FileBeforeStrip):\r
+                os.remove(FileBeforeStrip)\r
             shutil.copyfile(self.SectFileName, FileBeforeStrip)\r
             StrippedFile = os.path.join(OutputPath, ModuleName + '.stripped')\r
             StripCmd = (\r
index 50d1b95..4750605 100644 (file)
@@ -243,10 +243,14 @@ class EfiSection (EfiSectionClassObject):
                         MapFile = File.replace('.efi', '.map')\r
                         if os.path.exists(MapFile):\r
                             CopyMapFile = os.path.join(OutputPath, ModuleName + '.map')\r
+                            if os.path.exists(CopyMapFile):\r
+                                os.remove(CopyMapFile)\r
                             shutil.copyfile(MapFile, CopyMapFile)\r
 \r
                     if not NoStrip:\r
                         FileBeforeStrip = os.path.join(OutputPath, ModuleName + '.efi')\r
+                        if os.path.exists(FileBeforeStrip):\r
+                            os.remove(FileBeforeStrip)\r
                         shutil.copyfile(File, FileBeforeStrip)\r
                         StrippedFile = os.path.join(OutputPath, ModuleName + '.stripped')\r
                         StripCmd = (\r
index f573515..5a8d492 100644 (file)
@@ -356,6 +356,8 @@ class FfsInfStatement(FfsInfStatementClassObject):
                 \r
                 if not NoStrip:\r
                     FileBeforeStrip = os.path.join(self.OutputPath, ModuleName + '.reloc')\r
+                    if os.path.exists(FileBeforeStrip):\r
+                        os.remove(FileBeforeStrip)\r
                     shutil.copyfile(File, FileBeforeStrip)\r
                     StrippedFile = os.path.join(self.OutputPath, ModuleName + '.stipped')\r
                     StripCmd = (\r