Package choosing algorithm ...

Houder houder@xs4all.nl
Wed Apr 6 10:29:00 GMT 2016


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 <std::string, packagemeta *> 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

=====
-------------- next part --------------
A non-text attachment was scrubbed...
Name: package_meta_cc.patch
Type: text/x-diff
Size: 869 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20160406/5c36089e/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: package_meta_h.patch
Type: text/x-diff
Size: 856 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20160406/5c36089e/attachment-0001.bin>
-------------- next part --------------
--
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


More information about the Cygwin mailing list