From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 77479 invoked by alias); 15 Mar 2018 21:02:53 -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 77460 invoked by uid 89); 15 Mar 2018 21:02:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2283, offer, transaction, Hx-spam-relays-external:ESMTPA X-HELO: out5-smtp.messagingengine.com Received: from out5-smtp.messagingengine.com (HELO out5-smtp.messagingengine.com) (66.111.4.29) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 15 Mar 2018 21:02:50 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id D706920D89 for ; Thu, 15 Mar 2018 17:02:48 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute6.internal (MEProxy); Thu, 15 Mar 2018 17:02:48 -0400 X-ME-Sender: Received: from [192.168.1.102] (host31-51-206-142.range31-51.btcentralplus.com [31.51.206.142]) by mail.messagingengine.com (Postfix) with ESMTPA id 7387B24241 for ; Thu, 15 Mar 2018 17:02:48 -0400 (EDT) Subject: Re: setup: problems with local install To: "cygwin-apps@cygwin.com" References: <3cd80653-6a63-ae3d-d79c-a1642ad63fce@cornell.edu> <76209447-c5a7-2fa4-941e-4040a2de484f@dronecode.org.uk> <19b10cbb-42bc-c82f-be30-57296d3de6c9@cornell.edu> <2e15f4fb-60b5-49f8-ce8b-cd2a9c07271e@cornell.edu> <27cb1d93-5aba-8a38-14b2-c0de3eedcfdf@cornell.edu> <8aefd886-5dcc-2577-b757-7ff9e09c16c1@cornell.edu> From: Jon Turney Message-ID: Date: Thu, 15 Mar 2018 21:02:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <8aefd886-5dcc-2577-b757-7ff9e09c16c1@cornell.edu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-SW-Source: 2018-03/txt/msg00024.txt.bz2 On 14/03/2018 19:24, Ken Brown wrote: > On 3/14/2018 12:07 PM, Jon Turney wrote: >> On 12/03/2018 13:22, Ken Brown wrote: >>> On 3/8/2018 4:59 PM, Ken Brown wrote: >>>> On 3/8/2018 10:59 AM, Ken Brown wrote: >>>>> On 3/7/2018 4:52 PM, Ken Brown wrote: >>>>>> On 3/6/2018 1:47 PM, Jon Turney wrote: >>>>>>> On 06/03/2018 15:18, Jon Turney wrote: >>>>>> I've found another problem with local installs: If a package needs >>>>>> upgrading, then the chooser will offer the upgraded version for >>>>>> install, even if there's no archive available.  As a result, the >>>>>> current version will get uninstalled, and then setup will discover >>>>>> that it doesn't have the archive to install the new version. >> >> Thanks very much for finding this. >> >>>>>> The problem occurs because packagedb::defaultTrust() is called >>>>>> after ScanDownloadedFiles() has already done its work. >>>>>> solution.update() and solution.trans2db() are called, and >>>>>> pkg->desired is set equal to an inaccessible version pv (which has >>>>>> been previously removed from pkg->versions). >>>>>> >>>>>> I guess trans2db() should check that pv is in pkg->versions before >>>>>> acting on an install transaction for pv.  And then we also have to >>>>>> make sure to ignore the erase transaction for the current version >>>>>> of pkg. >>>>>> >>>>>> Alternatively, can we just remove an inaccessible packageversion >>>>>> from the libsolv pool, or at at least just tell libsolv that we >>>>>> don't want to install it? >> >> Attached is an attempt at that. >> >> I think this is preferable, if it works correctly, as I think avoiding >> solutions with these unavailable versions is better than trying to >> massage the solution afterwards. > > I agree, and it does seem to work correctly.  But there's one other case > that it doesn't cover:  Suppose there's no archive for the installed > version.  Even with your patch, the user can still choose 'Reinstall', > which will fail.  The first of the patches from my previous email fixes > this case. Yes. I applied that as well. The subtlety I'd failed to grasp when I wrote that comment is that ScanDownloadedFiles() prunes versions which aren't available locally, *except* if they are already installed. Thanks.