public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
From: Ken Brown <kbrown@cornell.edu>
To: cygwin-apps@cygwin.com
Subject: [PATCH setup 2/2] Whitespace fixes
Date: Mon, 06 Nov 2017 21:49:00 -0000	[thread overview]
Message-ID: <20171106214907.7120-3-kbrown@cornell.edu> (raw)
In-Reply-To: <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

  reply	other threads:[~2017-11-06 21:49 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-06 21:49 [PATCH setup 0/2] Improve behavior after download error Ken Brown
2017-11-06 21:49 ` Ken Brown [this message]
2017-11-06 21:49 ` [PATCH setup 1/2] " Ken Brown
2017-11-07  4:28 ` [PATCH setup 0/2] " Brian Inglis
2017-11-07 18:56   ` Jon Turney
2017-11-08 14:35     ` Ken Brown
2017-11-08 18:52       ` Brian Inglis
2017-11-09 13:21         ` Jon Turney
2017-11-09 16:42           ` Ken Brown
2017-11-10 14:41             ` Ken Brown
2017-11-08 18:46     ` Brian Inglis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171106214907.7120-3-kbrown@cornell.edu \
    --to=kbrown@cornell.edu \
    --cc=cygwin-apps@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).