This is the mail archive of the cygwin-apps@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Setup.exe 2.218.2.9 does not like its own source


I've been trying to understand why setup has problems
with its own source.

When you select the Setup package in the chooser and then
check the source box it will download and install the source,
but you will get the 'Download Incomplete' dialog, as reported
by several people.
In setup.ini the setup package is the only one with only
a 'source:' line and no 'install:' line.
Setup has an implicit assumption that every package version has
both a binary and a source.
I found the place in package_meta.cc where it goes wrong.
It is in the method set_action. There the flag desired->binpicked
is forced to 1 while (in the case of setup) there is no binary package.
This creates an exception late in do_download_thread.

The attached patch makes setup download the source of setup
without complaining.

I am not totally at home with all the logic in package_meta.cc
and its interaction with the chooser to know if this change causes
other problems.
So I will not be surprised if this is not the 'right' solution.

I tried a fresh install with this patch applied, and setup happily
selected all packages in Base and Misc (why Misc, see next message)
and downloaded/installed them.

The relevant part of package_meta.cc (starting at line 321)
is below:
-----------------------------------------------------------------
 else if (desired == installed
           && (!installed || !(installed->binpicked || installed->srcpicked)))
    /* Install the default trust version - this is a 'reinstall' for installed
       * packages */
    {
      desired = NULL;
      /* No-op */
      desired = default_version;
      if (desired)
        {
          desired->binpicked = 1;
          return;
        }
    }
------------------------------------------------------------------
In the case of the setup package, desired and installed are both NULL.
As you can see the logic puts desired->binpicked to 1 for the
default_version.
My patch only puts desired->binpicked to 1 if installed is not NULL.

This problem probably also exists in HEAD.
package_meta.cc has not changed in this area.

Regards,

Ton van Overbeek

Attachment: package_meta.diff
Description: Text document



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]