From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 90423 invoked by alias); 18 Oct 2017 16:14:03 -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 90402 invoked by uid 89); 18 Oct 2017 16:14:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-21.4 required=5.0 tests=AWL,BAYES_50,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=HX-Junkmail-Premium-Raw:__URI_IN_BODY, HX-Junkmail-Premium-Raw:score, HX-Junkmail-Premium-Raw:2.7.2, HX-Junkmail-Premium-Raw:sk:__SUBJ_ X-HELO: rgout0804.bt.lon5.cpcloud.co.uk Received: from rgout0804.bt.lon5.cpcloud.co.uk (HELO rgout0804.bt.lon5.cpcloud.co.uk) (65.20.0.151) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 18 Oct 2017 16:14:00 +0000 X-OWM-Source-IP: 86.179.113.201 (GB) X-OWM-Env-Sender: jonturney@btinternet.com X-Junkmail-Premium-Raw: score=7/50,refid=2.7.2:2017.10.18.154816:17:7.944,ip=,rules=__HAS_FROM, __TO_MALFORMED_2, __TO_NO_NAME, __HAS_CC_HDR, __CC_NAME, __CC_NAME_DIFF_FROM_ACC, __SUBJ_ALPHA_END, __HAS_MSGID, __SANE_MSGID, __HAS_X_MAILER, __FROM_DOMAIN_IN_ANY_CC1, __ANY_URI, __HTTPS_URI, __URI_WITH_PATH, URI_ENDS_IN_HTML, __URI_NO_WWW, __CP_URI_IN_BODY, __URI_IN_BODY, __URI_NOT_IMG, __NO_HTML_TAG_RAW, BODYTEXTP_SIZE_3000_LESS, BODY_SIZE_2000_2999, __MIME_TEXT_P1, __MIME_TEXT_ONLY, __URI_NS, HTML_00_01, HTML_00_10, BODY_SIZE_5000_LESS, __FROM_DOMAIN_IN_RCPT, __CC_REAL_NAMES, MULTIPLE_REAL_RCPTS, LEGITIMATE_SIGNS, __SINGLE_URI_TEXT, SINGLE_URI_IN_BODY, __MIME_TEXT_P, BODY_SIZE_7000_LESS, URI_WITH_PATH_ONLY Received: from localhost.localdomain (86.179.113.201) by rgout08.bt.lon5.cpcloud.co.uk (9.0.019.13-1) (authenticated as jonturney@btinternet.com) id 58BFF08017515F43; Wed, 18 Oct 2017 17:13:57 +0100 From: Jon Turney To: cygwin-apps@cygwin.com Cc: Jon Turney Subject: [PATCH setup] Fix spinning after replace-on-reboot failure or skipped Date: Wed, 18 Oct 2017 16:14:00 -0000 Message-Id: <20171018161344.54840-1-jon.turney@dronecode.org.uk> X-SW-Source: 2017-10/txt/msg00072.txt.bz2 If: - extracting a file failed AND --no-replaceonreboot was used - OR, writing the .new file for replacing on reboot failed we don't advance to the next file in the archive, so we just sit there, trying the same operation repeatedly. Yes, this seems to mean that --no-replaceonreboot never worked usefully. Also advance to next file in extract_other error case. See https://cygwin.com/ml/cygwin/2017-10/msg00090.html Signed-off-by: Jon Turney --- install.cc | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/install.cc b/install.cc index f8f0b59..a47edcd 100644 --- a/install.cc +++ b/install.cc @@ -498,6 +498,8 @@ Installer::installOne (packagemeta &pkgm, const packageversion &ver, archive::extract_results extres; while ((extres = archive::extract_file (tarstream, prefixURL, prefixPath)) != archive::extract_ok) { + bool error_in_this_file = false; + switch (extres) { case archive::extract_inuse: // in use @@ -602,13 +604,13 @@ Installer::installOne (packagemeta &pkgm, const packageversion &ver, if (NoReplaceOnReboot) { ++errors; - error_in_this_package = true; + error_in_this_file = true; Log (LOG_PLAIN) << "Not replacing in-use file " << prefixURL << prefixPath << fn << endLog; } else { - error_in_this_package = extract_replace_on_reboot(tarstream, prefixURL, prefixPath, fn); + error_in_this_file = extract_replace_on_reboot(tarstream, prefixURL, prefixPath, fn); } } break; @@ -633,8 +635,7 @@ Installer::installOne (packagemeta &pkgm, const packageversion &ver, MB_OK | MB_ICONWARNING | MB_TASKMODAL); } - // don't mark this package as successfully installed - error_in_this_package = true; + error_in_this_file = true; } break; case archive::extract_ok: @@ -642,6 +643,16 @@ Installer::installOne (packagemeta &pkgm, const packageversion &ver, } // We're done with this file + + // if an error occured ... + if (error_in_this_file) + { + // skip to next file in archive + tarstream->skip_file(); + // don't mark this package as successfully installed + error_in_this_package = true; + } + break; } progress (pkgfile->tell ()); -- 2.14.2