[Scummvm-git-logs] scummvm master -> 0d3ca5fa9751a3239d92149e07273de6a772c6e0
sev-
sev at scummvm.org
Mon Jul 19 10:19:23 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:
0d3ca5fa97 DEVTOOLS: Implement conversion to UTF8 for dumper-companion script
Commit: 0d3ca5fa9751a3239d92149e07273de6a772c6e0
https://github.com/scummvm/scummvm/commit/0d3ca5fa9751a3239d92149e07273de6a772c6e0
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-07-19T12:19:14+02:00
Commit Message:
DEVTOOLS: Implement conversion to UTF8 for dumper-companion script
Changed paths:
devtools/dumper-companion.pl
diff --git a/devtools/dumper-companion.pl b/devtools/dumper-companion.pl
index d3d32f8afb..cb3f0e729f 100644
--- a/devtools/dumper-companion.pl
+++ b/devtools/dumper-companion.pl
@@ -2,6 +2,7 @@
use strict;
use Getopt::Std;
+use Encode;
sub VERSION_MESSAGE() {
print "$0 version 1.0\n"
@@ -32,14 +33,17 @@ sub processIso($) {
system("hmount \"$isofile\" >/dev/null 2>&1") == 0 or die "Can't execute hmount";
print "done\n";
- open(my $ls, "-|", "hls -1ablRU");
+ open(my $ls, "-|", "hls -1alRU");
my $dir = "";
my $mdir = "";
+ my $numfiles = 0;
+ my $numdirs = 0;
+ my $prevlen = 0;
+
while (<$ls>) {
chomp;
- print "$_... \r";
flush STDOUT;
if (/^:/) {
@@ -47,24 +51,43 @@ sub processIso($) {
s/^://;
s/:/\//g;
$dir = $_;
- mkdir "$_";
+ 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$fname");
+ system("hcopy -m -- \"$mdir$fname\" \"$dir$decfname\"");
} else {
- system("hcopy -r -- $mdir$fname $dir$fname");
+ system("hcopy -r -- \"$mdir$fname\" \"$dir$decfname\"");
}
+ $numfiles++;
} else {
die "Bad format:\n$_\n";
}
}
}
- print "\n";
+ print " " x $prevlen;
+ print "\rExtracted $numdirs dirs and $numfiles files\n";
print "Unounting ISO...";
flush STDOUT;
@@ -89,7 +112,7 @@ Mode 1:
Mode 2:
$0 [-e <encoding>] -f <file.iso>
Operate in disk dumping mode
- Optionally specify 'jap' for using 'recode' for converting Japanese file names
+ Optionally specify encoding (MacRoman, MacJapanese)
Miscellaneous:
-h, --help display this help and exit
More information about the Scummvm-git-logs
mailing list