[Scummvm-git-logs] scummvm master -> cc28107847304fe8db68bf4df9da78961011d4ab

sev- noreply at scummvm.org
Mon Aug 29 19:37:50 UTC 2022


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:
eb888fa847 JANITORIAL: SCUMM: Make the MD5/filesize script more portable
cc28107847 JANITORIAL: SCUMM: Further simplify the small script example


Commit: eb888fa847b2aa6231b79a19f6089148d3749b0b
    https://github.com/scummvm/scummvm/commit/eb888fa847b2aa6231b79a19f6089148d3749b0b
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2022-08-29T21:37:46+02:00

Commit Message:
JANITORIAL: SCUMM: Make the MD5/filesize script more portable

The included script relied on GNU flags; this should now work on most
POSIX shells.

Tested on macOS 12, OpenBSD 7.1, Debian 11.

Changed paths:
    devtools/scumm-md5.txt


diff --git a/devtools/scumm-md5.txt b/devtools/scumm-md5.txt
index 9e7ad8ab47f..877cee7f8b1 100644
--- a/devtools/scumm-md5.txt
+++ b/devtools/scumm-md5.txt
@@ -4,8 +4,8 @@
 # GAMEID <TAB> DESCRIPTION
 # After this follows an arbitrary number of lines start with a tab. Each line
 # describes one specific variant of the game. It contains tab separated data:
-#  - MD5
-#  - file size (or -1 if unknown)
+#  - MD5 (first 1,048,576 bytes)
+#  - file size (or -1 if unknown, but only in last resort)
 #  - Language (two letter code)
 #  - Platform
 #  - Variant id
@@ -39,13 +39,14 @@
 # of detect files, automatically inserting the values in here:
 #
 # #!/bin/sh
+# set -f
 # OIFS=$IFS
 # IFS="
 # "
-# for i in `find -name 00.*` `find -name 000.*` `find -name *.??0` `find -name *Data*` ; do
-#	m=`head -c 1048576 "$i" | md5sum | cut -f1 -d' '` ;
-#	s=`du -b "$i" | cut -f1` ;
-#	sed -i -e "s/$m\t-1/$m\t$s/" /PATH/TO/scumm-md5.txt ;
+# for i in $(find . \( -name '00.*' -o -name '000.*' -o -name '*.??0' -o -name '*Data*' \) -type f); do
+#	m=$(dd if="$i" bs=1024k count=1 2>/dev/null | openssl dgst -md5 | awk '{print $NF}')
+#	s=$(wc -c < "$i" | awk '{print $1}')
+#	sed -i -e "s/$m\t-1/$m\t$s/" /PATH/TO/scumm-md5.txt
 # done
 # IFS=$OIFS
 #


Commit: cc28107847304fe8db68bf4df9da78961011d4ab
    https://github.com/scummvm/scummvm/commit/cc28107847304fe8db68bf4df9da78961011d4ab
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2022-08-29T21:37:46+02:00

Commit Message:
JANITORIAL: SCUMM: Further simplify the small script example

Avoid mangling IFS and just use `read` with a `for` loop, as suggested
by lephilousophe.

Changed paths:
    devtools/scumm-md5.txt


diff --git a/devtools/scumm-md5.txt b/devtools/scumm-md5.txt
index 877cee7f8b1..f945eb32ce1 100644
--- a/devtools/scumm-md5.txt
+++ b/devtools/scumm-md5.txt
@@ -39,16 +39,11 @@
 # of detect files, automatically inserting the values in here:
 #
 # #!/bin/sh
-# set -f
-# OIFS=$IFS
-# IFS="
-# "
-# for i in $(find . \( -name '00.*' -o -name '000.*' -o -name '*.??0' -o -name '*Data*' \) -type f); do
+# find . \( -name '00.*' -o -name '000.*' -o -name '*.??0' -o -name '*Data*' \) -type f | while read -r i; do
 #	m=$(dd if="$i" bs=1024k count=1 2>/dev/null | openssl dgst -md5 | awk '{print $NF}')
 #	s=$(wc -c < "$i" | awk '{print $1}')
 #	sed -i -e "s/$m\t-1/$m\t$s/" /PATH/TO/scumm-md5.txt
 # done
-# IFS=$OIFS
 #
 maniac	Maniac Mansion
 	2d624d1b214f7faf0094daea65c6d1a6	1188	en	2gs	Apple II	-	-




More information about the Scummvm-git-logs mailing list