[Scummvm-git-logs] scummvm master -> 004ab05ebb3545b91bd01df0c9cf71341c36e380

trembyle 54326852+trembyle at users.noreply.github.com
Sat Nov 13 16:32:22 UTC 2021


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
004ab05ebb DEVTOOLS: Set the modified time for folders in dumper_companion


Commit: 004ab05ebb3545b91bd01df0c9cf71341c36e380
    https://github.com/scummvm/scummvm/commit/004ab05ebb3545b91bd01df0c9cf71341c36e380
Author: eientei (log.butt at gmail.com)
Date: 2021-11-13T11:32:19-05:00

Commit Message:
DEVTOOLS: Set the modified time for folders in dumper_companion

Changed paths:
    devtools/dumper-companion.py


diff --git a/devtools/dumper-companion.py b/devtools/dumper-companion.py
index 08cc59ea53..180e84a902 100755
--- a/devtools/dumper-companion.py
+++ b/devtools/dumper-companion.py
@@ -285,6 +285,7 @@ def extract_volume(args: argparse.Namespace) -> int:
 
     destination_dir.mkdir(parents=True, exist_ok=True)
     for hpath, obj in vol.iter_paths():
+        # Encode the path
         upath = destination_dir
         for el in hpath:
             if japanese:
@@ -294,8 +295,11 @@ def extract_volume(args: argparse.Namespace) -> int:
 
             upath /= el
 
+        # Write the file to disk
         if isinstance(obj, machfs.Folder):
             upath.mkdir(exist_ok=True)
+            # Set the modified time for folders
+            os.utime(upath, (obj.mddate - 2082844800, obj.mddate - 2082844800))
         else:
             print(upath)
             file = obj.data
@@ -303,6 +307,10 @@ def extract_volume(args: argparse.Namespace) -> int:
                 file = file_to_macbin(obj, hpath[-1].encode("mac_roman"))
             upath.write_bytes(file)
             os.utime(upath, (obj.mddate - 2082844800, obj.mddate - 2082844800))
+            # This needs to be done after writing files as writing files resets
+            # the parent folder's modified time that was set before
+            parent_folder_modtime = vol.get(hpath[:-1]).mddate - 2082844800
+            os.utime(upath.parent, (parent_folder_modtime, parent_folder_modtime))
     return 0
 
 




More information about the Scummvm-git-logs mailing list