]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/AutoGen/AutoGen.py
BaseTools:Update binary cache restore time to current time
[mirror_edk2.git] / BaseTools / Source / Python / AutoGen / AutoGen.py
index a843f294b94a5e9d643147fc008ee42789583d4d..f1b8f9364bf7871c31ccd40b152bed15f9baeb1e 100644 (file)
@@ -3897,7 +3897,7 @@ class ModuleAutoGen(AutoGen):
             self.CopyModuleToCache()\r
 \r
     def CopyModuleToCache(self):\r
-        FileDir = path.join(GlobalData.gBinCacheDest, self.PlatformInfo.Name, self.BuildTarget + "_" + self.ToolChain, self.Arch, self.SourceDir, self.MetaFile.BaseName)\r
+        FileDir = path.join(GlobalData.gBinCacheDest, self.PlatformInfo.OutputDir, self.BuildTarget + "_" + self.ToolChain, self.Arch, self.SourceDir, self.MetaFile.BaseName)\r
         CreateDirectory (FileDir)\r
         HashFile = path.join(self.BuildDir, self.Name + '.hash')\r
         if os.path.exists(HashFile):\r
@@ -3906,6 +3906,12 @@ class ModuleAutoGen(AutoGen):
             ModuleFile = path.join(self.OutputDir, self.Name + '.inf')\r
             if os.path.exists(ModuleFile):\r
                 shutil.copy2(ModuleFile, FileDir)\r
+        else:\r
+            OutputDir = self.OutputDir.replace('\\', '/').strip('/')\r
+            DebugDir = self.DebugDir.replace('\\', '/').strip('/')\r
+            for Item in self.CodaTargetList:\r
+                File = Item.Target.Path.replace('\\', '/').strip('/').replace(DebugDir, '').replace(OutputDir, '').strip('/')\r
+                self.OutputFile.add(File)\r
         if not self.OutputFile:\r
             Ma = self.BuildDatabase[self.MetaFile, self.Arch, self.BuildTarget, self.ToolChain]\r
             self.OutputFile = Ma.Binaries\r
@@ -3929,7 +3935,7 @@ class ModuleAutoGen(AutoGen):
         for f_ext in self.SourceFileList:\r
             if '.inc' in str(f_ext):\r
                 return False\r
-        FileDir = path.join(GlobalData.gBinCacheSource, self.PlatformInfo.Name, self.BuildTarget + "_" + self.ToolChain, self.Arch, self.SourceDir, self.MetaFile.BaseName)\r
+        FileDir = path.join(GlobalData.gBinCacheSource, self.PlatformInfo.OutputDir, self.BuildTarget + "_" + self.ToolChain, self.Arch, self.SourceDir, self.MetaFile.BaseName)\r
         HashFile = path.join(FileDir, self.Name + '.hash')\r
         if os.path.exists(HashFile):\r
             f = open(HashFile, 'r')\r
@@ -3941,14 +3947,14 @@ class ModuleAutoGen(AutoGen):
                     for root, dir, files in os.walk(FileDir):\r
                         for f in files:\r
                             if self.Name + '.hash' in f:\r
-                                shutil.copy2(HashFile, self.BuildDir)\r
+                                shutil.copy(HashFile, self.BuildDir)\r
                             else:\r
                                 File = path.join(root, f)\r
                                 sub_dir = os.path.relpath(File, FileDir)\r
                                 destination_file = os.path.join(self.OutputDir, sub_dir)\r
                                 destination_dir = os.path.dirname(destination_file)\r
                                 CreateDirectory(destination_dir)\r
-                                shutil.copy2(File, destination_dir)\r
+                                shutil.copy(File, destination_dir)\r
                     if self.Name == "PcdPeim" or self.Name == "PcdDxe":\r
                         CreatePcdDatabaseCode(self, TemplateString(), TemplateString())\r
                     return True\r