BaseTools:Update binary cache restore time to current time
authorSteven Shi <steven.shi@intel.com>
Tue, 28 May 2019 08:35:14 +0000 (16:35 +0800)
committerFeng, Bob C <bob.c.feng@intel.com>
Fri, 31 May 2019 11:46:18 +0000 (19:46 +0800)
https://bugzilla.tianocore.org/show_bug.cgi?id=1742

Current Binary Cache doesn't update the restored file
creation and modification times to the current time.
Preserve the new restored file creation time as old
cached time might has potential issue to block the make
to build updated files based on the time stamp.
Enhance to update the restored file creation time to
current time.

Cc: Liming Gao <liming.gao@intel.com>
Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Zhiju Fan <zhijux.fan@intel.com>
Signed-off-by: Steven Shi <steven.shi@intel.com>
Reviewed-by: Bob Feng <bob.c.feng@intel.com>
BaseTools/Source/Python/AutoGen/AutoGen.py

index 7b35f83..f1b8f93 100644 (file)
@@ -3947,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