From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28036 invoked by alias); 18 May 2016 16:09:29 -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 28025 invoked by uid 89); 18 May 2016 16:09:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-96.1 required=5.0 tests=AWL,BAYES_00,GOOD_FROM_CORINNA_CYGWIN,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_PBL,RDNS_DYNAMIC autolearn=ham version=3.3.2 spammy=Hx-languages-length:5253, accesible, satisfied, Class X-HELO: calimero.vinschen.de Received: from ipbcc04766.dynamic.kabel-deutschland.de (HELO calimero.vinschen.de) (188.192.71.102) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 18 May 2016 16:09:13 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id 183E5A803E7; Wed, 18 May 2016 18:09:11 +0200 (CEST) Date: Wed, 18 May 2016 16:09:00 -0000 From: Corinna Vinschen To: cygwin-apps@cygwin.com Subject: Re: [PATCH] Do not clear the prev, curr and exp fields of packagemeta. Never. Message-ID: <20160518160911.GE361@calimero.vinschen.de> Reply-To: cygwin-apps@cygwin.com Mail-Followup-To: cygwin-apps@cygwin.com References: <510b310a3f4f5a19abf1349216f013b3@xs4all.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="XWOWbaMNXpFDWE00" Content-Disposition: inline In-Reply-To: <510b310a3f4f5a19abf1349216f013b3@xs4all.nl> User-Agent: Mutt/1.6.1 (2016-04-27) X-SW-Source: 2016-05/txt/msg00082.txt.bz2 --XWOWbaMNXpFDWE00 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 5816 On May 4 14:38, Houder wrote: > Hi, >=20 > I have prepared a patch to setup.exe, but I do not know how to submit it. > For > this reason. I have attached the result of 'git format-patch' to this > message. >=20 > Please, submit this patch. >=20 > This patch rectifies >=20 > - packagemeta::ScanDownloadedFiles (package_meta.cc), and > - packagemeta::trustp (package_meta.h) >=20 > Clarification: > Class packagemeta has "fields" prev, curr, exp and installed, which in fa= ct > represent the info from setup.ini/installed.db, and should never be clear= ed > therefore. _Currently_ these fields are cleared in ScanDownloadedFiles() = in > order to notify that the tarball for the associated field is not availabl= e. > This is a mistake, as it destroys relevant info (e.g. the version number = of > a version). > To ascertain whether or not the associated tarball is available, one shou= ld > invoke .accesible(). >=20 > Note: yes, "field" is type packageversion. The patch seems to make sense, but I'm currently so busy with non-Cygwin stuff that I'm not sure I'm looking cross-eyed. Can somebody hacking on setup have a look, too, please? Thanks, Corinna >=20 > Regards, > henri > From 3ddf47d9c75a6a547b9121dccf9a6ea3c0e4cd33 Mon Sep 17 00:00:00 2001 > From: Henri > Date: Wed, 4 May 2016 13:06:34 +0200 > Subject: [PATCH] Do not clear the prev, curr and exp fields of packagemet= a. > Never. >=20 > * package_meta.cc (packagemeta::ScanDownloadedFiles): Do _not_ clear the= prev, > curr or exp "fields" of a package in order to notify that the tarball = is not > available (accessible). These fields contain relevant info from setup.= ini. > The same applies for the installed field (from installed.db) of a pack= age. > Rather remove these statements from ScanDownloadedFiles(), because the= y are > problably a left over from earlier days. > To ascertain whether the tarball, associated with a version, is availa= ble or > not, the method .accessible() should be invoked. >=20 > * package_meta.h (packagemeta::trustp): use the accessible() method in o= rder > to verify whether or not the associated tarball is available for a ver= sion. > Note: in order to be able to compare version numbers of different vers= ions, > the fields prev, curr, exp and installed should have been initialised = from > setup.ini and installed.db, and should never have been cleared. > --- > package_meta.cc | 16 ++++++++++++++-- > package_meta.h | 21 +++++++++++++++++++-- > 2 files changed, 33 insertions(+), 4 deletions(-) >=20 > diff --git a/package_meta.cc b/package_meta.cc > index 34ff78c..cc5dc0a 100644 > --- a/package_meta.cc > +++ b/package_meta.cc > @@ -683,15 +683,27 @@ packagemeta::ScanDownloadedFiles (bool mirror_mode) > /* For local installs, if there is no src and no bin, the version > * is unavailable > */ > - if (!i->accessible () && !pkgsrcver.accessible () > - && *i !=3D pkg.installed) > + if (*i !=3D pkg.installed > + && !i->accessible () && !pkgsrcver.accessible () ) > { > + /* > + - remove a version from versions (a set) in case the asso= ciated > + tarball is not available (accessible) > + - however, do not remove the info that has been collected= from > + setup.ini and installed.db, because you might need it t= o e.g. > + compare the version numbers of different versions > + - package_meta::trustp(): use .accesible() in or= der to > + verify whether or not the associated tarball is availab= le (for > + version =3D prev, curr or exp) > + */ > + #if 0 > if (pkg.prev =3D=3D *i) > pkg.prev =3D packageversion (); > if (pkg.curr =3D=3D *i) > pkg.curr =3D packageversion (); > if (pkg.exp =3D=3D *i) > pkg.exp =3D packageversion (); > + #endif > pkg.versions.erase (i++); > /* For now, leave the source version alone */ > } > diff --git a/package_meta.h b/package_meta.h > index b24d4fc..b2f35e7 100644 > --- a/package_meta.h > +++ b/package_meta.h > @@ -105,12 +105,29 @@ public: > if (_default && curr && installed > && packageversion::compareVersions (curr, installed) < 0) > { > - if (exp && packageversion::compareVersions (installed, exp) < 0) > + /* > + - the expression above (i.e. curr && installed) reflect that se= tup.ini > + has a current entry for the package, and that the package is = also in > + installed.db > + - this expression is a precondition that must be satisfied, or = else it > + would not be possible to invoke the comparision function > + - below it is sufficient to use exp.accessible() as a precondit= ion, as > + it implies that exp is true > + (if setup.ini does not have an experimental entry, exp.access= ible() > + will yield false) > + - at the same time the expression verifies that the associated = tarball > + is available > + */ > + if (exp.accessible() && packageversion::compareVersions (installed, exp= ) < 0) > return exp; > return installed; > } > /* Otherwise, if a "curr" version exists, return "curr". */ > - if (curr) > + /* > + - again, use accessible() to verify whether or not the associated t= arball > + is available > + */ > + if (curr.accessible() ) > return curr; > /* Otherwise return the installed version. */ > return installed; > --=20 > 2.8.0 >=20 --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --XWOWbaMNXpFDWE00 Content-Type: application/pgp-signature; name="signature.asc" Content-length: 819 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJXPJOmAAoJEPU2Bp2uRE+g+s8QAKZxLbb1c96Sf45S9Y+opaxv 0kVgIkveEbGI0yA7QeQ/2Rt3zQO1+qR2BvP0RRFLE2L7AlIBCrTD61RauvERzCv1 XMT8DlDBSdqceqZKOHzHIoO3gSqXvlpr4w5Aej9UeHn8dwnr9b0jGGZMpiAjNXVy yu/PerlKpHJPDcUbT0fgKoHNVtbVrjf779eJIBDef8fZcOf5H3SwMqE8mqKXLDyt Em2AtdKiPcTIvZklk9K3FGEIdpXVMrpUnJ/ZQYM4aCDeA3QCfsZuSVlxIK2gGkMx 69m/6NeF/oKRrs3xjYFXr6KtBdVTWkaFQdTNVGCsv8XlGUVNmzWG3/M8hLZyslwB BG/fqkIgQyIATCde52EV70V8F5N7NF57a3lHyJdbMr9JHUSOi1cQO4Mnwj9qSL1e NWvbIm/2X25TfCHw0M7kxmOay16jf5BZ95Wj0LrLumfNvDmcgscB2GI2IEhMCGgA Z0Ia7fOpJ9hWKg7zE+44HZUd5YapqYdJlf+OtMmYqIOB347zhUKgorhDXzMOsNa8 pW/qp1fyEw1tedG9FfPcQFgFsohUurfEmurirVmlTGqzISxkQfAe1fdaSH7xCsMc ssoskl8GjHqj3h9B+9H7TnVfyWUfVB9oxEZTs9KkK390MFr0U89ZDKUeaKUomblR WZELv+hGZMisCOdVWzzs =PhCO -----END PGP SIGNATURE----- --XWOWbaMNXpFDWE00--