Mailing-List: contact cygwin-apps-help AT cygwin DOT com; run by ezmlm Sender: cygwin-apps-owner AT cygwin DOT com List-Subscribe: List-Archive: List-Post: List-Help: , Mail-Followup-To: cygwin-apps AT cygwin DOT com Delivered-To: mailing list cygwin-apps AT cygwin DOT com Message-Id: <3.0.6.32.20020519192551.007a1980@127.0.0.1> X-Sender: ton AT 127 DOT 0 DOT 0 DOT 1 (Unverified) Date: Sun, 19 May 2002 19:25:51 +0200 To: cygwin-apps AT cygwin DOT com From: Ton van Overbeek Subject: [PATCH] Setup.exe 2.218.2.9 does not like its own source Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=====================_1021821951==_" --=====================_1021821951==_ Content-Type: text/plain; charset="us-ascii" 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 --=====================_1021821951==_ Content-Type: text/plain; charset="us-ascii" Content-Disposition: attachment; filename="package_meta.diff" --- package_meta.cc.orig 2002-03-26 01:25:16.000000000 +0100 +++ package_meta.cc 2002-05-19 16:11:32.000000000 +0200 @@ -328,7 +328,8 @@ packagemeta::set_action (packageversion desired = default_version; if (desired) { - desired->binpicked = 1; + if (installed) + desired->binpicked = 1; return; } } --=====================_1021821951==_ Content-Type: text/plain; charset="us-ascii" --=====================_1021821951==_--