[Scummvm-cvs-logs] scummvm master -> e3c5eb9afa59d59cb3415a1ddde9753035db7e89

digitall dgturner at iee.org
Sat Dec 6 00:14:13 CET 2014


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

Summary:
f1fae53731 DEBUGGER: Add "md5" command, to get the MD5 sum of entire files
84548847a1 DEBUGGER: Add "md5mac" command to get MD5 sum of Mac resource fork.
ce37e489f8 DEBUGGER: Sort "md5" output, when using wildcards.
37aa4c2d59 DEBUGGER: Changed usage output from "md5mac"
14ce84da9a DEBUGGER: Let "md5mac" print the MD5 sum of both resource and data
6bc36cbdf4 DEBUGGER: Add FIXME comment about file name vs base name
e3c5eb9afa Merge pull request #497 from eriktorbjorn/md5-debug


Commit: f1fae5373130c2c0986476f53a193f3ba2d760ab
    https://github.com/scummvm/scummvm/commit/f1fae5373130c2c0986476f53a193f3ba2d760ab
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2014-09-01T20:24:23+02:00

Commit Message:
DEBUGGER: Add "md5" command, to get the MD5 sum of entire files

This may make it easier to ask users for the MD5 sum of a file, in
case we suspect a bug report is caused by damaged files.

Changed paths:
    gui/debugger.cpp
    gui/debugger.h



diff --git a/gui/debugger.cpp b/gui/debugger.cpp
index dcdc18d..ff365b0 100644
--- a/gui/debugger.cpp
+++ b/gui/debugger.cpp
@@ -27,6 +27,12 @@
 #include "common/debug-channels.h"
 #include "common/system.h"
 
+#ifndef DISABLE_MD5
+#include "common/md5.h"
+#include "common/archive.h"
+#include "common/stream.h"
+#endif
+
 #include "engines/engine.h"
 
 #include "gui/debugger.h"
@@ -61,6 +67,9 @@ Debugger::Debugger() {
 
 	registerCmd("help",				WRAP_METHOD(Debugger, cmdHelp));
 	registerCmd("openlog",			WRAP_METHOD(Debugger, cmdOpenLog));
+#ifndef DISABLE_MD5
+	registerCmd("md5",				WRAP_METHOD(Debugger, cmdMd5));
+#endif
 
 	registerCmd("debuglevel",		WRAP_METHOD(Debugger, cmdDebugLevel));
 	registerCmd("debugflag_list",		WRAP_METHOD(Debugger, cmdDebugFlagsList));
@@ -502,6 +511,32 @@ bool Debugger::cmdOpenLog(int argc, const char **argv) {
 	return true;
 }
 
+#ifndef DISABLE_MD5
+bool Debugger::cmdMd5(int argc, const char **argv) {
+	if (argc < 2) {
+		debugPrintf("md5 <filename | pattern>\n");
+	} else {
+		// Assume that spaces are part of a single filename.
+		Common::String filename = argv[1];
+		for (int i = 2; i < argc; i++) {
+			filename = filename + " " + argv[i];
+		}
+		Common::ArchiveMemberList list;
+		SearchMan.listMatchingMembers(list, filename);
+		if (list.empty()) {
+			debugPrintf("File '%s' not found\n", filename.c_str());
+		} else {
+			for (Common::ArchiveMemberList::iterator iter = list.begin(); iter != list.end(); ++iter) {
+				Common::ReadStream *stream = (*iter)->createReadStream();
+				Common::String md5 = Common::computeStreamMD5AsString(*stream, 0);
+				debugPrintf("%s  %s\n", md5.c_str(), (*iter)->getDisplayName().c_str());
+				delete stream;
+			}
+		}
+	}
+	return true;
+}
+#endif
 
 bool Debugger::cmdDebugLevel(int argc, const char **argv) {
 	if (argc == 1) { // print level
diff --git a/gui/debugger.h b/gui/debugger.h
index 8c7481b..3a82950 100644
--- a/gui/debugger.h
+++ b/gui/debugger.h
@@ -213,6 +213,9 @@ protected:
 	bool cmdExit(int argc, const char **argv);
 	bool cmdHelp(int argc, const char **argv);
 	bool cmdOpenLog(int argc, const char **argv);
+#ifndef DISABLE_MD5
+	bool cmdMd5(int argc, const char **argv);
+#endif
 	bool cmdDebugLevel(int argc, const char **argv);
 	bool cmdDebugFlagsList(int argc, const char **argv);
 	bool cmdDebugFlagEnable(int argc, const char **argv);


Commit: 84548847a13de7366875894243e9e5d5a46a4aec
    https://github.com/scummvm/scummvm/commit/84548847a13de7366875894243e9e5d5a46a4aec
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2014-09-01T21:19:48+02:00

Commit Message:
DEBUGGER: Add "md5mac" command to get MD5 sum of Mac resource fork.

Changed paths:
    gui/debugger.cpp
    gui/debugger.h



diff --git a/gui/debugger.cpp b/gui/debugger.cpp
index ff365b0..e0b2db1 100644
--- a/gui/debugger.cpp
+++ b/gui/debugger.cpp
@@ -30,6 +30,7 @@
 #ifndef DISABLE_MD5
 #include "common/md5.h"
 #include "common/archive.h"
+#include "common/macresman.h"
 #include "common/stream.h"
 #endif
 
@@ -69,6 +70,7 @@ Debugger::Debugger() {
 	registerCmd("openlog",			WRAP_METHOD(Debugger, cmdOpenLog));
 #ifndef DISABLE_MD5
 	registerCmd("md5",				WRAP_METHOD(Debugger, cmdMd5));
+	registerCmd("md5mac",			WRAP_METHOD(Debugger, cmdMd5Mac));
 #endif
 
 	registerCmd("debuglevel",		WRAP_METHOD(Debugger, cmdDebugLevel));
@@ -536,6 +538,31 @@ bool Debugger::cmdMd5(int argc, const char **argv) {
 	}
 	return true;
 }
+
+bool Debugger::cmdMd5Mac(int argc, const char **argv) {
+	if (argc < 2) {
+		debugPrintf("md5mac <filename>\n");
+	} else {
+		// Assume that spaces are part of a single filename.
+		Common::String filename = argv[1];
+		for (int i = 2; i < argc; i++) {
+			filename = filename + " " + argv[i];
+		}
+		Common::MacResManager macResMan;
+		if (!macResMan.open(filename)) {
+			debugPrintf("Resource file '%s' not found\n", filename.c_str());
+		} else {
+			Common::String md5 = macResMan.computeResForkMD5AsString(0);
+			if (md5.empty()) {
+				debugPrintf("'%s' has no resource fork\n", filename.c_str());
+			} else {
+				debugPrintf("%s  %s\n", md5.c_str(), macResMan.getBaseFileName().c_str());
+			}
+			macResMan.close();
+		}
+	}
+	return true;
+}
 #endif
 
 bool Debugger::cmdDebugLevel(int argc, const char **argv) {
diff --git a/gui/debugger.h b/gui/debugger.h
index 3a82950..4539ba9 100644
--- a/gui/debugger.h
+++ b/gui/debugger.h
@@ -215,6 +215,7 @@ protected:
 	bool cmdOpenLog(int argc, const char **argv);
 #ifndef DISABLE_MD5
 	bool cmdMd5(int argc, const char **argv);
+	bool cmdMd5Mac(int argc, const char **argv);
 #endif
 	bool cmdDebugLevel(int argc, const char **argv);
 	bool cmdDebugFlagsList(int argc, const char **argv);


Commit: ce37e489f83d8f33af36bc09cefa4352e827ec03
    https://github.com/scummvm/scummvm/commit/ce37e489f83d8f33af36bc09cefa4352e827ec03
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2014-09-07T18:14:50+02:00

Commit Message:
DEBUGGER: Sort "md5" output, when using wildcards.

Changed paths:
    gui/debugger.cpp



diff --git a/gui/debugger.cpp b/gui/debugger.cpp
index e0b2db1..5db2b97 100644
--- a/gui/debugger.cpp
+++ b/gui/debugger.cpp
@@ -514,6 +514,12 @@ bool Debugger::cmdOpenLog(int argc, const char **argv) {
 }
 
 #ifndef DISABLE_MD5
+struct ArchiveMemberLess {
+	bool operator()(const Common::ArchiveMemberPtr &x, const Common::ArchiveMemberPtr &y) const {
+		return (*x).getDisplayName().compareToIgnoreCase((*y).getDisplayName()) < 0;
+	}
+};
+
 bool Debugger::cmdMd5(int argc, const char **argv) {
 	if (argc < 2) {
 		debugPrintf("md5 <filename | pattern>\n");
@@ -528,6 +534,7 @@ bool Debugger::cmdMd5(int argc, const char **argv) {
 		if (list.empty()) {
 			debugPrintf("File '%s' not found\n", filename.c_str());
 		} else {
+			sort(list.begin(), list.end(), ArchiveMemberLess());
 			for (Common::ArchiveMemberList::iterator iter = list.begin(); iter != list.end(); ++iter) {
 				Common::ReadStream *stream = (*iter)->createReadStream();
 				Common::String md5 = Common::computeStreamMD5AsString(*stream, 0);


Commit: 37aa4c2d5955f7558bb06e89e50f017d6a87eac6
    https://github.com/scummvm/scummvm/commit/37aa4c2d5955f7558bb06e89e50f017d6a87eac6
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2014-09-07T18:30:40+02:00

Commit Message:
DEBUGGER: Changed usage output from "md5mac"

I don't know of any good way of transforming file names to base
file names, so document that "md5mac" expects the base file name.
Even though it currently will accept MacBinary file names.

Changed paths:
    gui/debugger.cpp



diff --git a/gui/debugger.cpp b/gui/debugger.cpp
index 5db2b97..48acda1 100644
--- a/gui/debugger.cpp
+++ b/gui/debugger.cpp
@@ -548,7 +548,7 @@ bool Debugger::cmdMd5(int argc, const char **argv) {
 
 bool Debugger::cmdMd5Mac(int argc, const char **argv) {
 	if (argc < 2) {
-		debugPrintf("md5mac <filename>\n");
+		debugPrintf("md5mac <base filename>\n");
 	} else {
 		// Assume that spaces are part of a single filename.
 		Common::String filename = argv[1];


Commit: 14ce84da9aec30aa89505f40d16e06df0b6725e4
    https://github.com/scummvm/scummvm/commit/14ce84da9aec30aa89505f40d16e06df0b6725e4
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2014-09-07T18:50:51+02:00

Commit Message:
DEBUGGER: Let "md5mac" print the MD5 sum of both resource and data

Changed paths:
    gui/debugger.cpp



diff --git a/gui/debugger.cpp b/gui/debugger.cpp
index 48acda1..560e516 100644
--- a/gui/debugger.cpp
+++ b/gui/debugger.cpp
@@ -559,11 +559,19 @@ bool Debugger::cmdMd5Mac(int argc, const char **argv) {
 		if (!macResMan.open(filename)) {
 			debugPrintf("Resource file '%s' not found\n", filename.c_str());
 		} else {
-			Common::String md5 = macResMan.computeResForkMD5AsString(0);
-			if (md5.empty()) {
-				debugPrintf("'%s' has no resource fork\n", filename.c_str());
+			if (!macResMan.hasResFork() && !macResMan.hasDataFork()) {
+				debugPrintf("'%s' has neither data not resource fork\n", macResMan.getBaseFileName().c_str());
 			} else {
-				debugPrintf("%s  %s\n", md5.c_str(), macResMan.getBaseFileName().c_str());
+				// The resource fork is probably the most relevant one.
+				if (macResMan.hasResFork()) {
+					Common::String md5 = macResMan.computeResForkMD5AsString(0);
+					debugPrintf("%s  %s (resource)\n", md5.c_str(), macResMan.getBaseFileName().c_str());
+				}
+				if (macResMan.hasDataFork()) {
+					Common::ReadStream *stream = macResMan.getDataFork();
+					Common::String md5 = Common::computeStreamMD5AsString(*stream, 0);
+					debugPrintf("%s  %s (data)\n", md5.c_str(), macResMan.getBaseFileName().c_str());
+				}
 			}
 			macResMan.close();
 		}


Commit: 6bc36cbdf412db1ce10adcdc50eb98135908612e
    https://github.com/scummvm/scummvm/commit/6bc36cbdf412db1ce10adcdc50eb98135908612e
Author: Torbjörn Andersson (eriktorbjorn at users.sourceforge.net)
Date: 2014-10-31T08:16:33+01:00

Commit Message:
DEBUGGER: Add FIXME comment about file name vs base name

Changed paths:
    gui/debugger.cpp



diff --git a/gui/debugger.cpp b/gui/debugger.cpp
index 560e516..216bd62 100644
--- a/gui/debugger.cpp
+++ b/gui/debugger.cpp
@@ -556,6 +556,10 @@ bool Debugger::cmdMd5Mac(int argc, const char **argv) {
 			filename = filename + " " + argv[i];
 		}
 		Common::MacResManager macResMan;
+		// FIXME: There currently isn't any way to tell the Mac resource
+		// manager to open a specific file. Instead, it takes a "base name"
+		// and constructs a file name out of that. While usually a desirable
+		// thing, it's not ideal here.
 		if (!macResMan.open(filename)) {
 			debugPrintf("Resource file '%s' not found\n", filename.c_str());
 		} else {


Commit: e3c5eb9afa59d59cb3415a1ddde9753035db7e89
    https://github.com/scummvm/scummvm/commit/e3c5eb9afa59d59cb3415a1ddde9753035db7e89
Author: David Turner (dgturner at iee.org)
Date: 2014-12-05T23:13:12Z

Commit Message:
Merge pull request #497 from eriktorbjorn/md5-debug

Add "md5" command to the debugger

Changed paths:
    gui/debugger.cpp
    gui/debugger.h









More information about the Scummvm-git-logs mailing list