[Scummvm-git-logs] scummvm master -> 81be6b459b41fec84f5286eaccf6bcb5b4d49e16

rvanlaar roland at rolandvanlaar.nl
Sat Aug 21 07:40:41 UTC 2021


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

Summary:
00d54a3358 DEVTOOLS: DUMPERCOMPANION: fix logging mac mode
81be6b459b DEVTOOLS: DUMPERCOMPANION: fix double encoding


Commit: 00d54a3358f08e30a179c795967d147189c90e5a
    https://github.com/scummvm/scummvm/commit/00d54a3358f08e30a179c795967d147189c90e5a
Author: Roland van Laar (roland at rolandvanlaar.nl)
Date: 2021-08-21T09:18:43+02:00

Commit Message:
DEVTOOLS: DUMPERCOMPANION: fix logging mac mode

Re-enable printing messages when punyencoding files in mac mode.

Changed paths:
    devtools/dumper-companion.py


diff --git a/devtools/dumper-companion.py b/devtools/dumper-companion.py
index 2d3fe67936..0d299c9d05 100755
--- a/devtools/dumper-companion.py
+++ b/devtools/dumper-companion.py
@@ -267,9 +267,9 @@ def punyencode_dir(directory: Path, verbose: bool = False) -> int:
 
     dirs.reverse()  # start renaming with the one at the bottom
 
-    renamed_files = punyencode_paths(files, verbose=verbose)
-    punyencode_paths(dirs, verbose=verbose)
-    return renamed_files
+    count = punyencode_paths(files, verbose=verbose)
+    count += punyencode_paths(dirs, verbose=verbose)
+    return count
 
 
 def has_resource_fork(dirpath: str, filename: str) -> bool:
@@ -335,7 +335,7 @@ def collect_forks(args: argparse.Namespace) -> int:
                         (info.st_mtime, info.st_mtime),
                     )
     if punify:
-        count_renames = punyencode_dir(directory)
+        count_renames = punyencode_dir(directory, verbose=True)
 
     print(f"Macbinary {count_resources}, Renamed {count_renames} files")
     return 0


Commit: 81be6b459b41fec84f5286eaccf6bcb5b4d49e16
    https://github.com/scummvm/scummvm/commit/81be6b459b41fec84f5286eaccf6bcb5b4d49e16
Author: Roland van Laar (roland at rolandvanlaar.nl)
Date: 2021-08-21T09:40:17+02:00

Commit Message:
DEVTOOLS: DUMPERCOMPANION: fix double encoding

\x81 is used as a control character to denote a special char.
\x81 was encoded put in the end result twice because of a missing elif.

Includes unittest fix.

Changed paths:
    devtools/dumper-companion.py


diff --git a/devtools/dumper-companion.py b/devtools/dumper-companion.py
index 0d299c9d05..b8ce9ae6a7 100755
--- a/devtools/dumper-companion.py
+++ b/devtools/dumper-companion.py
@@ -164,7 +164,7 @@ def escape_string(s: str) -> str:
     for char in s:
         if char == "\x81":
             new_name += "\x81\x79"
-        if char in '/":*[]+|\\?%<>,;=' or ord(char) < 0x20:
+        elif char in '/":*[]+|\\?%<>,;=' or ord(char) < 0x20:
             new_name += "\x81" + chr(0x80 + ord(char))
         else:
             new_name += char
@@ -431,6 +431,6 @@ def test_decode_name():
 
 
 def test_escape_string():
-    checks = [["\r", "\x81\x8d"], ["\x81", "\x81\x79\x81"]]
+    checks = [["\r", "\x81\x8d"], ["\x81", "\x81\x79"]]
     for input, expected in checks:
         assert escape_string(input) == expected




More information about the Scummvm-git-logs mailing list