From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 74835 invoked by alias); 6 Apr 2016 10:29:28 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 74825 invoked by uid 89); 6 Apr 2016 10:29:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPAM_SUBJECT1,SPF_PASS autolearn=no version=3.3.2 spammy=ALSO, repo, speaks, study X-HELO: lb2-smtp-cloud3.xs4all.net Received: from lb2-smtp-cloud3.xs4all.net (HELO lb2-smtp-cloud3.xs4all.net) (194.109.24.26) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Wed, 06 Apr 2016 10:29:17 +0000 Received: from webmail.xs4all.nl ([194.109.20.212]) by smtp-cloud3.xs4all.net with ESMTP id eyVD1s01A4aYjWA01yVDZE; Wed, 06 Apr 2016 12:29:13 +0200 Received: from a83-162-234-136.adsl.xs4all.nl ([83.162.234.136]) by webmail.xs4all.nl with HTTP (HTTP/1.1 POST); Wed, 06 Apr 2016 12:29:13 +0200 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=_ce03936e0744cde128e8964687c789d4" Date: Wed, 06 Apr 2016 10:29:00 -0000 From: Houder To: cygwin@cygwin.com Subject: Re: Package choosing algorithm ... In-Reply-To: <20160322095250.GK7179@calimero.vinschen.de> References: <20160321100007.GK3422@calimero.vinschen.de> <1a2fa4d86b78fbf1ccf8bc9a690e82e5@xs4all.nl> <20160322095250.GK7179@calimero.vinschen.de> Message-ID: X-Sender: houder@xs4all.nl (jjXMBYj3Uef20HkOuXafBA==) User-Agent: XS4ALL Webmail X-IsSubscribed: yes X-SW-Source: 2016-04/txt/msg00118.txt.bz2 --=_ce03936e0744cde128e8964687c789d4 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=US-ASCII; format=flowed Content-length: 4033 Title: Re: Package choosing agorithm ... Hi Corinna, (Of course I am formally addressing the project leader, but Achim, Jon, Yaakov, others? are welcome to correct me if I am wrong below). D w/o I = Download without Install I f LD = Install from Local Directory As a reminder: I reported that a new test release of Cygwin is NOT offered for install (having installed the previous test release) in my case. https://cygwin.com/ml/cygwin/2016-03/msg00425.html Relevant in my case is: - I am not using a local mirror ... - but a "partially populated Local Directory" - I do not invoke setup.exe with the -m option - my local directory does not have the current release of Cygwin As you replied "it works for me" and "not using the -m option should not make a difference", I decided to study the source code of setup.exe. As I had never seen the source code of setup before, I started my study where you had "left off" modifying (about a year ago). Subsequently, I reported back to the list, announcing that I found the bug, but was not sure I had. https://cygwin.com/ml/cygwin/2016-03/msg00480.html I was wrong. My patch did work, but for the wrong reasons. So does your modification of packagemeta::trustp ... Here is another attempt of mine (attempt? I seriously doubt whether there is someone which fully understands the source code in all its details ...) You will find 2 patch files attached. These patch files modify (correct): 1. packagemeta::ScanDownLoadedFiles and 2. packagemeta::trustp (yes, I do realize, that this correction to setup, is NOT important enough to most of you - using a local mirror and all that; consequently, do whatever you like with my post - I am merely providing info to the list). My argument for the correction is as follows: - packagedb::packages, a class variable, is the "package database" that is used by setup. - basically, it is a list of pairs (mapping between the packagename and its entry in setup.ini) (one where installed.db has been "integrated"). - formally: - typedef std::map packagecollection; - static packagecollection packages; - packagemeta is the type that describes a "package entry" from setup.ini - an object of type packagemeta does not only describe the previous, current and experimental (if applicable) lines from a package entry in setup.ini, it also describes the installed version of a package, as if installed.db is part of setup.ini. -- - bottom-line: the prev, curr, exp and installed data member of packagemeta are "static": these data members represent the info from setup.ini (and installed.db) and they should never be "nullified". - yet, that is exactly what happens in metapackage::ScanDownLoadedFiles. -- - packagemeta ALSO has a "not so static" data member, called versions; like packages, the contents of versions is "variable" - versions, a set of type packageversion, contains the versions of the package that are available (the source code speaks about "accessible") - available (in my simplistic view) means whether or not the tarball is present in the (local) repo - unfortunately, though versions specifies which versions are available, it does not tell us whether the previous, current or experimental version of a package is available or not -- - bottom-line: version numbers can be compared if that info is present in setup.ini; however, although the info may be present, it does not tell us that the associated tarball is available (neither does versions). - consequently, metapackage:trustp does not only have to verify that setup.ini has the required info, it also has to verify that the tarball is available, before it can give the "go-ahead". Lastly: No, I have not tested (been able) my modification for each possible configuration out there (for instance, I do not install source tarballs). Regards, Henri ===== --=_ce03936e0744cde128e8964687c789d4 Content-Transfer-Encoding: base64 Content-Type: text/x-diff; name=package_meta_cc.patch Content-Disposition: attachment; filename=package_meta_cc.patch; size=869 Content-length: 1180 ZGlmZiAtLWdpdCBhL3BhY2thZ2VfbWV0YS5jYyBiL3BhY2thZ2VfbWV0YS5j YwppbmRleCAzNGZmNzhjLi5mZjc4N2E4IDEwMDY0NAotLS0gYS9wYWNrYWdl X21ldGEuY2MKKysrIGIvLi4vc3JjMi9wYWNrYWdlX21ldGEuY2MKQEAgLTY4 MywxNSArNjgzLDE4IEBAIHBhY2thZ2VtZXRhOjpTY2FuRG93bmxvYWRlZEZp bGVzIChib29sIG1pcnJvcl9tb2RlKQogCSAgLyogRm9yIGxvY2FsIGluc3Rh bGxzLCBpZiB0aGVyZSBpcyBubyBzcmMgYW5kIG5vIGJpbiwgdGhlIHZlcnNp b24KIAkgICAqIGlzIHVuYXZhaWxhYmxlCiAJICAgKi8KLQkgIGlmICghaS0+ YWNjZXNzaWJsZSAoKSAmJiAhcGtnc3JjdmVyLmFjY2Vzc2libGUgKCkKLQkg ICAgICAmJiAqaSAhPSBwa2cuaW5zdGFsbGVkKQorCSAgaWYgKCppICE9IHBr Zy5pbnN0YWxsZWQKKwkgICAgICAmJiAhaS0+YWNjZXNzaWJsZSAoKSAmJiAh cGtnc3JjdmVyLmFjY2Vzc2libGUgKCkgKQogCSAgICB7CisvLyBIZW5yaTog aW5uaWhpbGF0ZSB0aGUgaW5mbyB0aGF0IGhhcyBiZWVuIGNvbGxlY3RlZCBm cm9tIHNldHVwLmluaT8gRE8gTk9UIQorCSAgICAgICNpZiAwCiAJICAgICAg aWYgKHBrZy5wcmV2ID09ICppKQogCQlwa2cucHJldiA9IHBhY2thZ2V2ZXJz aW9uICgpOwogCSAgICAgIGlmIChwa2cuY3VyciA9PSAqaSkKIAkJcGtnLmN1 cnIgPSBwYWNrYWdldmVyc2lvbiAoKTsKIAkgICAgICBpZiAocGtnLmV4cCA9 PSAqaSkKIAkJcGtnLmV4cCA9IHBhY2thZ2V2ZXJzaW9uICgpOworCSAgICAg ICNlbmRpZgogCSAgICAgIHBrZy52ZXJzaW9ucy5lcmFzZSAoaSsrKTsKIAkg ICAgICAvKiBGb3Igbm93LCBsZWF2ZSB0aGUgc291cmNlIHZlcnNpb24gYWxv bmUgKi8KIAkgICAgfQo= --=_ce03936e0744cde128e8964687c789d4 Content-Transfer-Encoding: base64 Content-Type: text/x-diff; name=package_meta_h.patch Content-Disposition: attachment; filename=package_meta_h.patch; size=856 Content-length: 1164 ZGlmZiAtLWdpdCBhL3BhY2thZ2VfbWV0YS5oIGIvcGFja2FnZV9tZXRhLmgK aW5kZXggYjI0ZDRmYy4uM2QyYjc3NSAxMDA2NDQKLS0tIGEvcGFja2FnZV9t ZXRhLmgKKysrIGIvLi4vc3JjMi9wYWNrYWdlX21ldGEuaApAQCAtMTA1LDEy ICsxMDUsMTQgQEAgcHVibGljOgogICAgIGlmIChfZGVmYXVsdCAmJiBjdXJy ICYmIGluc3RhbGxlZAogCSYmIHBhY2thZ2V2ZXJzaW9uOjpjb21wYXJlVmVy c2lvbnMgKGN1cnIsIGluc3RhbGxlZCkgPCAwKQogICAgICAgewotCWlmIChl eHAgJiYgcGFja2FnZXZlcnNpb246OmNvbXBhcmVWZXJzaW9ucyAoaW5zdGFs bGVkLCBleHApIDwgMCkKKy8vIEhlbnJpOiBubywgbm8sIG5vIC4uLiBmaXJz dCBjaGVjayB3aGV0aGVyIHRoZSBhc3NvY2lhdGVkIHRhcmJhbGwgaXMgaW4g dGhlIHJlcG8gb3Igbm90IQorCWlmIChleHAuYWNjZXNzaWJsZSgpICYmIGV4 cCAmJiBwYWNrYWdldmVyc2lvbjo6Y29tcGFyZVZlcnNpb25zIChpbnN0YWxs ZWQsIGV4cCkgPCAwKQogCSAgcmV0dXJuIGV4cDsKIAlyZXR1cm4gaW5zdGFs bGVkOwogICAgICAgfQogICAgIC8qIE90aGVyd2lzZSwgaWYgYSAiY3VyciIg dmVyc2lvbiBleGlzdHMsIHJldHVybiAiY3VyciIuICovCi0gICAgaWYgKGN1 cnIpCisvLyBIZW5yaTogbm8sIG5vLCBubyAuLi4gZmlyc3QgY2hlY2sgd2hl dGhlciB0aGUgYXNzb2NpYXRlZCB0YXJiYWxsIGlzIGluIHRoZSByZXBvIG9y IG5vdCEKKyAgICBpZiAoY3Vyci5hY2Nlc3NpYmxlKCkgJiYgY3VycikKICAg ICAgIHJldHVybiBjdXJyOwogICAgIC8qIE90aGVyd2lzZSByZXR1cm4gdGhl IGluc3RhbGxlZCB2ZXJzaW9uLiAqLwogICAgIHJldHVybiBpbnN0YWxsZWQ7 Cg== --=_ce03936e0744cde128e8964687c789d4 Content-Type: text/plain; charset=us-ascii Content-length: 218 -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple --=_ce03936e0744cde128e8964687c789d4--