From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 34292 invoked by alias); 28 Oct 2017 17:29:21 -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 34282 invoked by uid 89); 28 Oct 2017 17:29:20 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.5 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=Hx-languages-length:1096 X-HELO: limerock04.mail.cornell.edu Received: from limerock04.mail.cornell.edu (HELO limerock04.mail.cornell.edu) (128.84.13.244) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 28 Oct 2017 17:29:18 +0000 X-CornellRouted: This message has been Routed already. Received: from authusersmtp.mail.cornell.edu (granite4.serverfarm.cornell.edu [10.16.197.9]) by limerock04.mail.cornell.edu (8.14.4/8.14.4_cu) with ESMTP id v9SHTFaW008768 for ; Sat, 28 Oct 2017 13:29:15 -0400 Received: from [10.13.22.3] (65-112-130-194.dia.static.qwest.net [65.112.130.194]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id v9SHTDWR027822 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT) for ; Sat, 28 Oct 2017 13:29:14 -0400 Subject: Re: [[PATCH setup topic/libsolv] 2/2] Avoid clobbering installed.db when no setup.ini is found To: cygwin-apps@cygwin.com References: <20171028122932.3024-1-kbrown@cornell.edu> <20171028122932.3024-2-kbrown@cornell.edu> From: Ken Brown Message-ID: <5d65ebc4-58ca-46f0-a060-a14ba97d2c93@cornell.edu> Date: Sat, 28 Oct 2017 17:29:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171028122932.3024-2-kbrown@cornell.edu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-PMX-Cornell-Gauge: Gauge=X X-PMX-CORNELL-AUTH-RESULTS: dkim-out=none; X-IsSubscribed: yes X-SW-Source: 2017-10/txt/msg00160.txt.bz2 On 10/28/2017 8:29 AM, Ken Brown wrote: > Move the calls to packagedb::read and other packagedb functions from > do_ini_thread to ChooserPage::OnInit. If no setup.ini is found, > do_ini_thread is never called. But we need to ensure that > packagedb::read is called, or else installed.db gets emptied. > --- > choose.cc | 5 +++++ > ini.cc | 7 ------- > 2 files changed, 5 insertions(+), 7 deletions(-) > > diff --git a/choose.cc b/choose.cc > index 619d7db..013a30a 100644 > --- a/choose.cc > +++ b/choose.cc > @@ -268,6 +268,11 @@ ChooserPage::OnInit () > packagemeta::ScanDownloadedFiles (MirrorOption); > > packagedb db; > + db.makeBase(); > + db.read(); > + db.upgrade(); > + db.fixup_source_package_ids(); > + db.removeEmptyCategories(); > db.setExistence (); > db.fillMissingCategory (); Sorry, this isn't quite right. The new calls need happen before ScanDownLoadedFiles is called, to avoid a crash when the latter looks for the installation tarballs. I'll send a revised patch shortly. Ken