This is the mail archive of the
mailing list for the Cygwin project.
[PATCH] Setup.exe: don't download forever in unattended mode.
- From: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- To: cygwin-apps <cygwin-apps at cygwin dot com>
- Date: Wed, 04 Nov 2009 17:47:15 +0000
- Subject: [PATCH] Setup.exe: don't download forever in unattended mode.
In unattended mode, setup.exe automatically answers "yes" to all message
boxes. If the message box is asking whether to retry an incomplete download,
and the reason for the incomplete download is something non-transient, like
the localhost or the mirror going offline, or a file is missing from the
mirror, then it'll happily run forever. This patch adds a simple retry limit
to the download stage in unattended mode; if it takes more than five goes, it
* download.cc (do_download_thread): Only retry an incomplete download
a limited number of times in unattended mode.
Tested on a local mirror, by removing a package file. OK?
RCS file: /cvs/cygwin-apps/setup/download.cc,v
retrieving revision 2.50
diff -p -u -r2.50 download.cc
--- download.cc 19 Aug 2008 21:04:14 -0000 2.50
+++ download.cc 4 Nov 2009 16:31:39 -0000
@@ -275,10 +275,26 @@ do_download_thread (HINSTANCE h, HWND ow
- if (yesno (owner, IDS_DOWNLOAD_INCOMPLETE) == IDYES)
+ /* In unattended mode, all dialog boxes automatically get
+ answered with a Yes/OK/other positive response. This
+ means that if there's a download problem, setup will
+ potentially retry forever if we don't take care to give
+ up at some finite point. */
+ static int retries = 4;
+ if (unattended_mode && retries-- <= 0)
+ log (LOG_PLAIN) << "download error in unattended_mode: out of retries" << endLog;
+ exit_msg = IDS_INSTALL_INCOMPLETE;
+ LogSingleton::GetInstance().exit (1);
+ else if (unattended_mode)
+ log (LOG_PLAIN) << "download error in unattended_mode: " << retries
+ << (retries > 1 ? " retries" : " retry") << " remaining." << endLog;
+ else if (yesno (owner, IDS_DOWNLOAD_INCOMPLETE) == IDYES)
+ return IDD_SITE;
if (source == IDC_SOURCE_DOWNLOAD)