[Scummvm-git-logs] scummvm master -> 8952db2dfd83d453e03e8312cde4fe8c25600774

sev- sev at scummvm.org
Mon Aug 9 20:09:43 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:
8952db2dfd DEVTOOLS: COMPANION: Fix mac mode and set file timestamps


Commit: 8952db2dfd83d453e03e8312cde4fe8c25600774
    https://github.com/scummvm/scummvm/commit/8952db2dfd83d453e03e8312cde4fe8c25600774
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-08-09T22:09:03+02:00

Commit Message:
DEVTOOLS: COMPANION: Fix mac mode and set file timestamps

Changed paths:
    devtools/dumper-companion.py


diff --git a/devtools/dumper-companion.py b/devtools/dumper-companion.py
index af8b5831d5..637176991a 100755
--- a/devtools/dumper-companion.py
+++ b/devtools/dumper-companion.py
@@ -149,18 +149,25 @@ def collect_forks(args: argparse.Namespace) -> None:
             if has_resource_fork(dirpath, filename):
                 print(f"Resource in {filename}")
                 count_resources += 1
-                data_filename = filename
-                to_filename = data_filename + ".bin"
+                resource_filename = filename + "/..namedfork/rsrc"
+                to_filename = filename + ".bin"
                 if punify:
                     tmp = punyencode(to_filename)
                     if tmp != to_filename:
                         print(f"Renamed {to_filename} to {tmp}")
                         count_renames += 1
                     to_filename = tmp
-                with open(os.path.join(dirpath, filename), "rb") as rsrc:
-                    file = machfs.File()
+
+                file = machfs.File()
+
+                # Set the file times and convert them to Mac epoch
+                info = os.stat(filename)
+                file.crdate = 2082844800 + int(info.st_birthtime)
+                file.mddate = 2082844800 + int(info.st_mtime)
+
+                with open(os.path.join(dirpath, resource_filename), "rb") as rsrc:
                     file.rsrc = rsrc.read()
-                with open(os.path.join(dirpath, data_filename), "rb") as data:
+                with open(os.path.join(dirpath, filename), "rb") as data:
                     file.data = data.read()
                 with open(os.path.join(dirpath, to_filename), "wb") as to_file:
                     to_file.write(




More information about the Scummvm-git-logs mailing list