[Scummvm-git-logs] scummvm master -> 10cf2d85445a61d05cdda919be73a5fe4586b2d1
sev-
sev at scummvm.org
Mon Jul 19 10:58:21 UTC 2021
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
ec344292f0 DEVTOOLS: Implement macbinary encoding for dumper-companion
3f9bc93bfe JANITORIAL: Fix identation
55da451505 DEVTOOLS: Improve help message for dumper-companion
10cf2d8544 DEVTOOLS: encode-macbinary.sh is now obsolete. Removing
Commit: ec344292f0d1c1832f0626739c16abf7750231b5
https://github.com/scummvm/scummvm/commit/ec344292f0d1c1832f0626739c16abf7750231b5
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-07-19T12:58:05+02:00
Commit Message:
DEVTOOLS: Implement macbinary encoding for dumper-companion
Changed paths:
devtools/dumper-companion.pl
diff --git a/devtools/dumper-companion.pl b/devtools/dumper-companion.pl
index cb3f0e729f..2b0da37ec7 100644
--- a/devtools/dumper-companion.pl
+++ b/devtools/dumper-companion.pl
@@ -3,6 +3,7 @@
use strict;
use Getopt::Std;
use Encode;
+use File::Find;
sub VERSION_MESSAGE() {
print "$0 version 1.0\n"
@@ -10,6 +11,7 @@ sub VERSION_MESSAGE() {
sub HELP_MESSAGE();
sub processIso($);
+sub processMacbinary();
getopts('hmf:e:');
@@ -18,6 +20,11 @@ if ($::opt_h) {
exit 0;
}
+if ($::opt_m) {
+ processMacbinary;
+ exit 0;
+}
+
if ($::opt_f) {
processIso($::opt_f);
}
@@ -96,6 +103,22 @@ sub processIso($) {
print "done\n";
}
+sub processMacbinary() {
+ find( sub {
+ my $fname = $_;
+
+ if (open F, "$fname/..namedfork/rsrc") {
+ print "Resource in $fname\n";
+ close F;
+
+ system("macbinary encode \"$fname\"");
+ system("touch -r \"$fname\" \"$fname.bin\"");
+ system("mv \"$fname.bin\" \"$fname\"");
+ }
+ }, ".");
+
+}
+
sub HELP_MESSAGE() {
print <<EOF;
Usage: $0 [OPTIONS]...
Commit: 3f9bc93bfe46e89e139c009b7022127fc3091496
https://github.com/scummvm/scummvm/commit/3f9bc93bfe46e89e139c009b7022127fc3091496
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-07-19T12:58:05+02:00
Commit Message:
JANITORIAL: Fix identation
Changed paths:
devtools/dumper-companion.pl
diff --git a/devtools/dumper-companion.pl b/devtools/dumper-companion.pl
index 2b0da37ec7..0cd42fc248 100644
--- a/devtools/dumper-companion.pl
+++ b/devtools/dumper-companion.pl
@@ -6,7 +6,7 @@ use Encode;
use File::Find;
sub VERSION_MESSAGE() {
- print "$0 version 1.0\n"
+ print "$0 version 1.0\n"
}
sub HELP_MESSAGE();
@@ -16,106 +16,106 @@ sub processMacbinary();
getopts('hmf:e:');
if ($::opt_h) {
- HELP_MESSAGE();
- exit 0;
+ HELP_MESSAGE();
+ exit 0;
}
if ($::opt_m) {
- processMacbinary;
- exit 0;
+ processMacbinary;
+ exit 0;
}
if ($::opt_f) {
- processIso($::opt_f);
+ processIso($::opt_f);
}
exit 0;
sub processIso($) {
- my $isofile = shift;
-
- print "Mounting ISO...";
- flush STDOUT;
-
- system("hmount \"$isofile\" >/dev/null 2>&1") == 0 or die "Can't execute hmount";
- print "done\n";
-
- open(my $ls, "-|", "hls -1alRU");
-
- my $dir = "";
- my $mdir = "";
-
- my $numfiles = 0;
- my $numdirs = 0;
- my $prevlen = 0;
-
- while (<$ls>) {
- chomp;
- flush STDOUT;
-
- if (/^:/) {
- $mdir = $_;
- s/^://;
- s/:/\//g;
- $dir = $_;
- if ($::opt_e) {
- $dir = encode_utf8(decode($::opt_e, $dir));
- }
- mkdir "$dir";
- $numdirs++;
- } elsif (/^[fF]/) {
- if (/[fF]i?\s+[^\s]+\s+([0-9]+)\s+([0-9]+)\s+\w+\s+\d+\s+\d+\s+(.*)/) {
- my $res = $1;
- my $data = $2;
- my $fname = $3;
-
- $fname =~ s'/':'g; # Replace / with :
-
- my $decfname = $fname;
-
- if ($::opt_e) {
- $decfname = encode_utf8(decode($::opt_e, $fname));
- }
-
- print " " x $prevlen;
- print "\r$dir$decfname\r";
- $prevlen = length "$dir$decfname";
- flush STDOUT;
-
- if ($res != 0) {
- system("hcopy -m -- \"$mdir$fname\" \"$dir$decfname\"");
- } else {
- system("hcopy -r -- \"$mdir$fname\" \"$dir$decfname\"");
- }
- $numfiles++;
- } else {
- die "Bad format:\n$_\n";
- }
- }
- }
- print " " x $prevlen;
- print "\rExtracted $numdirs dirs and $numfiles files\n";
-
- print "Unounting ISO...";
- flush STDOUT;
-
- system("humount >/dev/null 2>&1") == 0 or die "Can't execute humount";
- print "done\n";
+ my $isofile = shift;
+
+ print "Mounting ISO...";
+ flush STDOUT;
+
+ system("hmount \"$isofile\" >/dev/null 2>&1") == 0 or die "Can't execute hmount";
+ print "done\n";
+
+ open(my $ls, "-|", "hls -1alRU");
+
+ my $dir = "";
+ my $mdir = "";
+
+ my $numfiles = 0;
+ my $numdirs = 0;
+ my $prevlen = 0;
+
+ while (<$ls>) {
+ chomp;
+ flush STDOUT;
+
+ if (/^:/) {
+ $mdir = $_;
+ s/^://;
+ s/:/\//g;
+ $dir = $_;
+ if ($::opt_e) {
+ $dir = encode_utf8(decode($::opt_e, $dir));
+ }
+ mkdir "$dir";
+ $numdirs++;
+ } elsif (/^[fF]/) {
+ if (/[fF]i?\s+[^\s]+\s+([0-9]+)\s+([0-9]+)\s+\w+\s+\d+\s+\d+\s+(.*)/) {
+ my $res = $1;
+ my $data = $2;
+ my $fname = $3;
+
+ $fname =~ s'/':'g; # Replace / with :
+
+ my $decfname = $fname;
+
+ if ($::opt_e) {
+ $decfname = encode_utf8(decode($::opt_e, $fname));
+ }
+
+ print " " x $prevlen;
+ print "\r$dir$decfname\r";
+ $prevlen = length "$dir$decfname";
+ flush STDOUT;
+
+ if ($res != 0) {
+ system("hcopy -m -- \"$mdir$fname\" \"$dir$decfname\"");
+ } else {
+ system("hcopy -r -- \"$mdir$fname\" \"$dir$decfname\"");
+ }
+ $numfiles++;
+ } else {
+ die "Bad format:\n$_\n";
+ }
+ }
+ }
+ print " " x $prevlen;
+ print "\rExtracted $numdirs dirs and $numfiles files\n";
+
+ print "Unounting ISO...";
+ flush STDOUT;
+
+ system("humount >/dev/null 2>&1") == 0 or die "Can't execute humount";
+ print "done\n";
}
sub processMacbinary() {
- find( sub {
- my $fname = $_;
+ find( sub {
+ my $fname = $_;
- if (open F, "$fname/..namedfork/rsrc") {
- print "Resource in $fname\n";
- close F;
+ if (open F, "$fname/..namedfork/rsrc") {
+ print "Resource in $fname\n";
+ close F;
- system("macbinary encode \"$fname\"");
+ system("macbinary encode \"$fname\"");
system("touch -r \"$fname\" \"$fname.bin\"");
system("mv \"$fname.bin\" \"$fname\"");
- }
- }, ".");
+ }
+ }, ".");
}
@@ -130,11 +130,11 @@ contents with hfsutils.
Mode 1:
$0 -m
- Operate in MacBinary encoding mode
+ Operate in MacBinary encoding mode
Mode 2:
$0 [-e <encoding>] -f <file.iso>
- Operate in disk dumping mode
+ Operate in disk dumping mode
Optionally specify encoding (MacRoman, MacJapanese)
Miscellaneous:
Commit: 55da451505d4caeeca95a5d0a154bdaca1031863
https://github.com/scummvm/scummvm/commit/55da451505d4caeeca95a5d0a154bdaca1031863
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-07-19T12:58:05+02:00
Commit Message:
DEVTOOLS: Improve help message for dumper-companion
Changed paths:
devtools/dumper-companion.pl
diff --git a/devtools/dumper-companion.pl b/devtools/dumper-companion.pl
index 0cd42fc248..e8d09633da 100644
--- a/devtools/dumper-companion.pl
+++ b/devtools/dumper-companion.pl
@@ -130,7 +130,7 @@ contents with hfsutils.
Mode 1:
$0 -m
- Operate in MacBinary encoding mode
+ Operate in MacBinary encoding mode. Recursively encode all resource forks in the current directory
Mode 2:
$0 [-e <encoding>] -f <file.iso>
Commit: 10cf2d85445a61d05cdda919be73a5fe4586b2d1
https://github.com/scummvm/scummvm/commit/10cf2d85445a61d05cdda919be73a5fe4586b2d1
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-07-19T12:58:05+02:00
Commit Message:
DEVTOOLS: encode-macbinary.sh is now obsolete. Removing
Changed paths:
R devtools/encode-macbinary.sh
diff --git a/devtools/encode-macbinary.sh b/devtools/encode-macbinary.sh
deleted file mode 100755
index cd836e8a33..0000000000
--- a/devtools/encode-macbinary.sh
+++ /dev/null
@@ -1,180 +0,0 @@
-#!/bin/bash
-
-usage() {
- cat << EOF
-Usage: $0 [OPTIONS]...
-
-Dumping Mac files into MacBinary format
-
-There are 2 operation modes. Direct MacBinary encoding (Mac-only) and dumping ISO
-contents with hfsutils.
-
-Mode 1:
- $0 macbinary
- Operate in MacBinary encoding mode
-
-Mode 2:
- $0 [jap] <file.iso>
- Operate in disk dumping mode
- Optionally specify 'jap' for using 'recode' for converting Japanese file names
-
-Miscellaneous:
- -h, --help display this help and exit
-EOF
-}
-
-path=
-jap=
-
-macbinarydump() {
- mypath=`realpath $0`
-
- for i in *
- do
- if test -d "$i" ; then
- cd "$i"
- if [ "$(ls -A .)" ] ; then # directory is not empty
- bash $mypath macbinary-phase2 "$path/$i"
- fi
- cd ..
- else
- echo -ne "$path/$i... \r"
- macbinary encode "$i"
- touch -r "$i" "$i.bin"
- mv "$i.bin" "$i"
- fi
- done
-}
-
-hfsdump() {
- mypath=`realpath $0`
-
- hls -F1a | while read i ; do
- macname=$i
- if [ -n $jap ] ; then
- i=`echo -n $i|recode $jap..utf-8`
- fi
-
- # Guard empty directories
- if [[ "$i" == "" ]] ; then
- continue
- fi
-
- if [[ "$i" =~ ":" ]] ; then
- dir="${i%?}" # Strip trailing ':'
- dir="${dir//\//:}" # Files could contain '/', replace those with ':'
- macdir="${macname%?}"
- hcd "$macdir"
- mkdir -- "$dir"
- cd -- "$dir"
- bash $mypath $jap hfsutils-phase2 "$path:$i"
- hcd ::
- cd ..
- else
- echo -ne "$path$i... \r"
- # Executable files have star at their end. Strip it
- if [[ "$i" =~ \*$ ]] ; then
- macfile="${macname%?}"
- file="${i%?}"
- else
- macfile="$macname"
- file="$i"
- fi
- fileunix="${file//\//:}" # Files could contain '/', replace those with ':'
-
- # Files could contain '*', '{', so backslash them to avoid globbing
- macfile="${macfile//\*/\\*}"
- macfile="${macfile//{/\\{}"
- hcopy -m -- "$macfile" "./$fileunix"
- fi
- done
-}
-
-for parm in "$@" ; do
- if test "$parm" = "--help" || test "$parm" = "-help" || test "$parm" = "-h" ; then
- usage
- exit 0
- fi
-done # for parm in ...
-
-if [[ $# -eq 0 ]] ; then
- usage
- exit 0
-fi
-
-if [[ $1 == "macbinary" ]] ; then
- if ! `command -v macbinary >/dev/null 2>/dev/null` ; then
- echo "macbinary not found. Exiting"
- exit 1
- fi
- macbinarydump
- echo
- exit 0
-fi
-
-if [[ $1 == "macbinary-phase2" ]] ; then
- path=$2
- macbinarydump
- exit 0
-fi
-
-###########
-# hfsutils mode
-if [ "$#" -lt 1 ] ; then
- usage
- exit 1
-fi
-
-case $1 in
- jap|SJIS)
- jap=SJIS
- shift
- ;;
- es|macintosh)
- jap=macintosh
- shift
- ;;
-esac
-
-if [ -n $jap ] ; then
- if ! `command -v recode >/dev/null 2>/dev/null` ; then
- echo "recode not found. Exiting"
- exit 1
- fi
-fi
-
-if [[ $1 == "hfsutils-phase2" ]] ; then
- path=$2
- hfsdump
- exit 0
-fi
-
-if ! `type hmount >/dev/null 2>/dev/null` ; then
- echo "hfsutils not found. Exiting"
- exit 1
-fi
-
-isofile="$1"
-
-echo -n "Mounting ISO..."
-hmount "$isofile" >/dev/null 2>/dev/null
-if test -z $? ; then
- echo error
- exit 1
-fi
-
-echo done
-
-echo "Dumping..."
-
-hfsdump
-echo
-
-echo -n "Unmounting ISO..."
-humount >/dev/null 2>/dev/null
-if test -z $? ; then
- echo error
- exit 1
-fi
-
-echo done
More information about the Scummvm-git-logs
mailing list