This is the mail archive of the
cygwin-apps@cygwin.com
mailing list for the Cygwin project.
setup.exe: Unhandled Exception if local copy of package haswrong md5sum but right filesize
- From: <huafbauer at compuserve dot de>
- To: cygwin-apps at cygwin dot com
- Date: Sun, 12 Sep 2004 23:45:57 -0500
- Subject: setup.exe: Unhandled Exception if local copy of package haswrong md5sum but right filesize
Hello,
I got the a error message by installing from a local package directory.
This error looks with version 2.427 like:
Microsoft Visual C++ Runtime Library
(X) Runtime Error!
Program: G:\transfer\private\cygwin-inst\test-cygwin\setup.exe
This application has requested the Runtime to terminate it in unusual way.
Please contact the application's support team for more information.
(like in message http://www.cygwin.com/ml/cygwin/2002-08/msg00002.html)
or with version 2.431
setup-2.431.exe
setup-2.431.exe has encountered a problem and needs to
close. We are sorry for the inconvenience.
...
with this patch (against cvs 20040912) a fatal messagebox opens instead:
diff U3 C:\Documents and
Settings\BUEBELACKER\source\cygwin-setup\cygwin-setup.org\cygwin-setup\setup\download.cc
C:\Documents and
Settings\BUEBELACKER\source\cygwin-setup\cygwin-setup\setup\download.cc
--- C:\Documents and
Settings\BUEBELACKER\source\cygwin-setup\cygwin-setup.org\cygwin-setup\setup\download.cc
Sun Sep 12 21:53:24 2004
+++ C:\Documents and
Settings\BUEBELACKER\source\cygwin-setup\cygwin-setup\setup\download.cc
Sun Sep 12 21:29:26 2004
@@ -122,34 +122,32 @@
String prefix = String ("file://") + local_dir + "/";
DWORD size;
- if ((size = get_file_size (prefix + pkgsource.Canonical ())) > 0)
- if (size == pkgsource.size)
- {
- if (validateCachedPackage (prefix + pkgsource.Canonical (), pkgsource))
- pkgsource.set_cached (prefix + pkgsource.Canonical ());
- else
- throw new Exception (TOSTRING(__LINE__) " " __FILE__, String
("Package validation failure for ") + prefix + pkgsource.Canonical (),
APPERR_CORRUPT_PACKAGE);
- return 1;
- }
+ if ((size = get_file_size (prefix + pkgsource.Canonical ())) > 0) {
+ if (size == pkgsource.size && validateCachedPackage (prefix +
pkgsource.Canonical (), pkgsource)) {
+ pkgsource.set_cached (prefix + pkgsource.Canonical ());
+ return 1;
+ } else {
+ throw new Exception (TOSTRING(__LINE__) " " __FILE__, String
("Package validation failure for ") + prefix + pkgsource.Canonical (),
APPERR_CORRUPT_PACKAGE);
+ }
+ }
/*
2) is there a version from one of the selected mirror sites
available ?
*/
for (packagesource::sitestype::const_iterator n =
pkgsource.sites.begin();
n != pkgsource.sites.end(); ++n)
- {
- String fullname = prefix + rfc1738_escape_part (n->key) + "/" +
- pkgsource.Canonical ();
- if ((size = get_file_size (fullname)) > 0)
- if (size == pkgsource.size)
- {
- if (validateCachedPackage (fullname, pkgsource))
- pkgsource.set_cached (fullname );
- else
- throw new Exception (TOSTRING(__LINE__) " " __FILE__, String
("Package validation failure for ") + fullname, APPERR_CORRUPT_PACKAGE);
- return 1;
- }
- }
+ {
+ String fullname = prefix + rfc1738_escape_part (n->key) + "/" +
+ pkgsource.Canonical ();
+ if ((size = get_file_size (fullname)) > 0) {
+ if (size == pkgsource.size && validateCachedPackage (fullname,
pkgsource)) {
+ pkgsource.set_cached (fullname );
+ return 1;
+ } else {
+ throw new Exception (TOSTRING(__LINE__) " " __FILE__, String
("Package validation failure for ") + fullname, APPERR_CORRUPT_PACKAGE);
+ }
+ }
+ }
return 0;
}
diff U3 C:\Documents and
Settings\BUEBELACKER\source\cygwin-setup\cygwin-setup.org\cygwin-setup\setup\package_meta.cc
C:\Documents and
Settings\BUEBELACKER\source\cygwin-setup\cygwin-setup\setup\package_meta.cc
--- C:\Documents and
Settings\BUEBELACKER\source\cygwin-setup\cygwin-setup.org\cygwin-setup\setup\package_meta.cc
Sun Apr 25 10:00:13 2004
+++ C:\Documents and
Settings\BUEBELACKER\source\cygwin-setup\cygwin-setup\setup\package_meta.cc
Sun Sep 12 21:31:26 2004
@@ -43,7 +43,10 @@
#include "package_db.h"
#include <algorithm>
-#include "Generic.h"
+#include "Generic.h"
+
+#include "Exception.h"
+#include "resource.h"
using namespace std;
@@ -654,8 +657,16 @@
for (set<packageversion>::iterator i = pkg.versions.begin ();
i != pkg.versions.end (); ++i)
{
- /* scan doesn't alter operator == for packageversions */
- const_cast<packageversion &>(*i).scan();
+ try {
+ /* scan doesn't alter operator == for packageversions */
+ const_cast<packageversion &>(*i).scan();
+ }
+ catch (Exception *e) {
+ if (e->errNo() == APPERR_CORRUPT_PACKAGE) {
+ fatal(NULL, IDS_CORRUPT_PACKAGE,
+ ( i->Name() + "-" + i->Canonical_version()
).cstr_oneuse() );
+ }
+ }
packageversion foo = *i;
packageversion pkgsrcver = foo.sourcePackage();
pkgsrcver.scan();
Mit freundlichen Grüßen
Bernhard