From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 59702 invoked by alias); 6 Nov 2017 21:49:23 -0000 Mailing-List: contact cygwin-apps-help@cygwin.com; run by ezmlm Precedence: bulk Sender: cygwin-apps-owner@cygwin.com List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Mail-Followup-To: cygwin-apps@cygwin.com Received: (qmail 59585 invoked by uid 89); 6 Nov 2017 21:49:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.9 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=unattended X-HELO: limerock01.mail.cornell.edu Received: from limerock01.mail.cornell.edu (HELO limerock01.mail.cornell.edu) (128.84.13.241) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 06 Nov 2017 21:49:20 +0000 X-CornellRouted: This message has been Routed already. Received: from authusersmtp.mail.cornell.edu (granite3.serverfarm.cornell.edu [10.16.197.8]) by limerock01.mail.cornell.edu (8.14.4/8.14.4_cu) with ESMTP id vA6LnHve030951; Mon, 6 Nov 2017 16:49:17 -0500 Received: from nothing.nyroc.rr.com (mta-68-175-129-7.twcny.rr.com [68.175.129.7] (may be forged)) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id vA6Ln6Go017144 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Mon, 6 Nov 2017 16:49:16 -0500 From: Ken Brown To: cygwin-apps@cygwin.com Subject: [PATCH setup 2/2] Whitespace fixes Date: Mon, 06 Nov 2017 21:49:00 -0000 Message-Id: <20171106214907.7120-3-kbrown@cornell.edu> In-Reply-To: <20171106214907.7120-1-kbrown@cornell.edu> References: <20171106214907.7120-1-kbrown@cornell.edu> X-PMX-Cornell-Gauge: Gauge=XXXXX X-PMX-CORNELL-AUTH-RESULTS: dkim-out=none; X-IsSubscribed: yes X-SW-Source: 2017-11/txt/msg00016.txt.bz2 --- 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