From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 99033 invoked by alias); 27 Oct 2017 18:47:43 -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 98929 invoked by uid 89); 27 Oct 2017 18:47:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.3 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=Guess X-HELO: limerock02.mail.cornell.edu Received: from limerock02.mail.cornell.edu (HELO limerock02.mail.cornell.edu) (128.84.13.242) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 27 Oct 2017 18:47:41 +0000 X-CornellRouted: This message has been Routed already. Received: from authusersmtp.mail.cornell.edu (granite4.serverfarm.cornell.edu [10.16.197.9]) by limerock02.mail.cornell.edu (8.14.4/8.14.4_cu) with ESMTP id v9RIlcUG025659; Fri, 27 Oct 2017 14:47:39 -0400 Received: from localhost.localdomain (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 v9RIlUG4024450 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 27 Oct 2017 14:47:38 -0400 From: Ken Brown To: cygwin-apps@cygwin.com Subject: [[PATCH setup] 2/3] Bump the installed.db version to 4 Date: Fri, 27 Oct 2017 18:47:00 -0000 Message-Id: <20171027184723.9324-3-kbrown@cornell.edu> In-Reply-To: <20171027184723.9324-1-kbrown@cornell.edu> References: <20171027184723.9324-1-kbrown@cornell.edu> X-PMX-Cornell-Gauge: Gauge=X X-PMX-CORNELL-AUTH-RESULTS: dkim-out=none; X-IsSubscribed: yes X-SW-Source: 2017-10/txt/msg00148.txt.bz2 Starting with the commit 'Remove the function filemanip.cc:base', setup correctly parses version numbers of the form e:v-r in installed.db. Bump the version of installed.db to reflect the fact that older setup doesn't parse filenames containing colons correctly. --- package_db.cc | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/package_db.cc b/package_db.cc index dbec17e..c108757 100644 --- a/package_db.cc +++ b/package_db.cc @@ -70,7 +70,7 @@ packagedb::packagedb () Log (LOG_BABBLE) << "INSTALLED.DB version " << dbver << endLog; - if (dbver <= 3) + if (dbver <= 4) { char inst[1000]; @@ -113,7 +113,7 @@ packagedb::packagedb () pkg->set_installed (binary); pkg->desired = pkg->installed; - if (dbver == 3) + if (dbver >= 3) pkg->user_picked = (user_picked & 1); } delete db; @@ -144,7 +144,7 @@ packagedb::flush () if (!ndb) return errno ? errno : 1; - ndb->write ("INSTALLED.DB 3\n", strlen ("INSTALLED.DB 3\n")); + ndb->write ("INSTALLED.DB 4\n", strlen ("INSTALLED.DB 4\n")); for (packagedb::packagecollection::iterator i = packages.begin (); i != packages.end (); ++i) { @@ -152,10 +152,13 @@ packagedb::flush () if (pkgm.installed) { /* - In INSTALLED.DB 3, lines are: 'packagename version flags', where - version is encoded in a notional filename for backwards - compatibility, and the only currently defined flag is user-picked - (bit 0). + Starting with INSTALLED.DB 3, lines are: 'packagename + version flags', where version is encoded in a notional + filename for backwards compatibility, and the only + currently defined flag is user-picked (bit 0). Starting + with INSTALLED.DB 4, the version number can have the form + e:v-r; earlier versions of setup will skip past the colon + and not parse this correctly. */ std::string line; line = pkgm.name + " " + @@ -182,7 +185,7 @@ packagedb::upgrade() /* Guess which packages were user_picked. This has to take place after setup.ini has been parsed as it needs dependency information. */ guessUserPicked(); - installeddbver = 3; + installeddbver = 4; } } -- 2.14.2