]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/GenFds/DataSection.py
There is a limitation on WINDOWS OS for the length of entire file path can’t be large...
[mirror_edk2.git] / BaseTools / Source / Python / GenFds / DataSection.py
index 0f41953ad42f6c2ba1a8fd825ed2f2c5b5c569c5..ba3677ed89db77ad558166a24f1dac74eaaf78df 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # process data section generation\r
 #\r
-#  Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -19,10 +19,10 @@ import Section
 from GenFdsGlobalVariable import GenFdsGlobalVariable\r
 import subprocess\r
 from Ffs import Ffs\r
-import os\r
+import Common.LongFilePathOs as os\r
 from CommonDataClass.FdfClass import DataSectionClassObject\r
 from Common.Misc import PeImageClass\r
-import shutil\r
+from Common.LongFilePathSupport import CopyLongFilePath\r
 \r
 ## generate data section\r
 #\r
@@ -71,9 +71,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 not os.path.exists(CopyMapFile) or \\r
-                    (os.path.getmtime(MapFile) > os.path.getmtime(CopyMapFile)):\r
-                    shutil.copyfile(MapFile, CopyMapFile)\r
+                if not os.path.exists(CopyMapFile) or (os.path.getmtime(MapFile) > os.path.getmtime(CopyMapFile)):\r
+                    CopyLongFilePath(MapFile, CopyMapFile)\r
 \r
         #Get PE Section alignment when align is set to AUTO\r
         if self.Alignment == 'Auto' and self.SecType in ('TE', 'PE32'):\r
@@ -92,7 +91,7 @@ class DataSection (DataSectionClassObject):
             FileBeforeStrip = os.path.join(OutputPath, ModuleName + '.efi')\r
             if not os.path.exists(FileBeforeStrip) or \\r
                 (os.path.getmtime(self.SectFileName) > os.path.getmtime(FileBeforeStrip)):\r
-                shutil.copyfile(self.SectFileName, FileBeforeStrip)\r
+                CopyLongFilePath(self.SectFileName, FileBeforeStrip)\r
             StrippedFile = os.path.join(OutputPath, ModuleName + '.stripped')\r
             GenFdsGlobalVariable.GenerateFirmwareImage(\r
                                     StrippedFile,\r