This is the mail archive of the
cygwin-apps
mailing list for the Cygwin project.
[PATCH setup 2/2] Whitespace fixes
- From: Ken Brown <kbrown at cornell dot edu>
- To: cygwin-apps at cygwin dot com
- Date: Mon, 6 Nov 2017 16:49:07 -0500
- Subject: [PATCH setup 2/2] Whitespace fixes
- Authentication-results: sourceware.org; auth=none
- References: <20171106214907.7120-1-kbrown@cornell.edu>
---
download.cc | 146 ++++++++++++++++++++++++++++++------------------------------
1 file changed, 73 insertions(+), 73 deletions(-)
diff --git a/download.cc b/download.cc
index 6ee64c1..89e2b7d 100644
--- a/download.cc
+++ b/download.cc
@@ -199,95 +199,95 @@ do_download_thread (HINSTANCE h, HWND owner)
do
{
- errors = 0;
- total_download_bytes = 0;
- total_download_bytes_sofar = 0;
-
- Progress.SetText1 ("Checking for packages to download...");
- Progress.SetText2 ("");
- Progress.SetText3 ("");
-
- packagedb db;
- /* calculate the amount needed */
- for (packagedb::packagecollection::iterator i = db.packages.begin ();
- i != db.packages.end (); ++i)
- {
- packagemeta & pkg = *(i->second);
- if (pkg.desired.picked () || pkg.desired.sourcePackage ().picked ())
+ errors = 0;
+ total_download_bytes = 0;
+ total_download_bytes_sofar = 0;
+
+ Progress.SetText1 ("Checking for packages to download...");
+ Progress.SetText2 ("");
+ Progress.SetText3 ("");
+
+ packagedb db;
+ /* calculate the amount needed */
+ for (packagedb::packagecollection::iterator i = db.packages.begin ();
+ i != db.packages.end (); ++i)
{
- packageversion version = pkg.desired;
- packageversion sourceversion = version.sourcePackage();
- try
+ packagemeta & pkg = *(i->second);
+ if (pkg.desired.picked () || pkg.desired.sourcePackage ().picked ())
{
- if (version.picked())
+ packageversion version = pkg.desired;
+ packageversion sourceversion = version.sourcePackage();
+ try
{
- if (!check_for_cached (*version.source()))
- total_download_bytes += version.source()->size;
+ if (version.picked())
+ {
+ if (!check_for_cached (*version.source()))
+ total_download_bytes += version.source()->size;
+ }
+ if (sourceversion.picked () || IncludeSource)
+ {
+ if (!check_for_cached (*sourceversion.source()))
+ total_download_bytes += sourceversion.source()->size;
+ }
}
- if (sourceversion.picked () || IncludeSource)
+ catch (Exception * e)
{
- if (!check_for_cached (*sourceversion.source()))
- total_download_bytes += sourceversion.source()->size;
+ // We know what to do with these..
+ if (e->errNo() == APPERR_CORRUPT_PACKAGE)
+ fatal (owner, IDS_CORRUPT_PACKAGE, pkg.name.c_str());
+ // Unexpected exception.
+ throw e;
}
}
- catch (Exception * e)
- {
- // We know what to do with these..
- if (e->errNo() == APPERR_CORRUPT_PACKAGE)
- fatal (owner, IDS_CORRUPT_PACKAGE, pkg.name.c_str());
- // Unexpected exception.
- throw e;
- }
- }
}
- /* and do the download. FIXME: This here we assign a new name for the cached version
- * and check that above.
- */
- for (packagedb::packagecollection::iterator i = db.packages.begin ();
- i != db.packages.end (); ++i)
- {
- packagemeta & pkg = *(i->second);
- if (pkg.desired.picked () || pkg.desired.sourcePackage ().picked ())
+ /* and do the download. FIXME: This here we assign a new name for the cached version
+ * and check that above.
+ */
+ for (packagedb::packagecollection::iterator i = db.packages.begin ();
+ i != db.packages.end (); ++i)
{
- int e = 0;
- packageversion version = pkg.desired;
- packageversion sourceversion = version.sourcePackage();
- if (version.picked())
- {
- e += download_one (*version.source(), owner);
- }
- if (sourceversion && (sourceversion.picked() || IncludeSource))
+ packagemeta & pkg = *(i->second);
+ if (pkg.desired.picked () || pkg.desired.sourcePackage ().picked ())
{
- e += download_one (*sourceversion.source (), owner);
- }
- errors += e;
+ int e = 0;
+ packageversion version = pkg.desired;
+ packageversion sourceversion = version.sourcePackage();
+ if (version.picked())
+ {
+ e += download_one (*version.source(), owner);
+ }
+ if (sourceversion && (sourceversion.picked() || IncludeSource))
+ {
+ e += download_one (*sourceversion.source (), owner);
+ }
+ errors += e;
#if 0
- if (e)
- pkg->action = ACTION_ERROR;
+ if (e)
+ pkg->action = ACTION_ERROR;
#endif
+ }
}
- }
- if (errors)
- {
- /* 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. */
- if (unattended_mode && --retries <= 0)
- {
- Log (LOG_PLAIN) << "download error in unattended_mode: out of retries" << endLog;
- Logger ().setExitMsg (IDS_INSTALL_INCOMPLETE);
- Logger ().exit (1);
+ if (errors)
+ {
+ /* 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. */
+ if (unattended_mode && --retries <= 0)
+ {
+ Log (LOG_PLAIN) << "download error in unattended_mode: out of retries" << endLog;
+ Logger ().setExitMsg (IDS_INSTALL_INCOMPLETE);
+ Logger ().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) == IDNO)
+ break;
}
- 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) == IDNO)
- break;
- }
}
while (errors);
--
2.15.0