delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-apps/2002/05/19/21:07:46

Mailing-List: contact cygwin-apps-help AT cygwin DOT com; run by ezmlm
Sender: cygwin-apps-owner AT cygwin DOT com
List-Subscribe: <mailto:cygwin-apps-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin-apps/>
List-Post: <mailto:cygwin-apps AT cygwin DOT com>
List-Help: <mailto:cygwin-apps-help AT cygwin DOT com>, <http://sources.redhat.com/lists.html#faqs>
Mail-Followup-To: cygwin-apps AT cygwin DOT com
Delivered-To: mailing list cygwin-apps AT cygwin DOT com
Subject: RE: [PATCH] Setup.exe 2.218.2.9 does not like its own source
MIME-Version: 1.0
Date: Mon, 20 May 2002 11:07:36 +1000
X-MimeOLE: Produced By Microsoft Exchange V6.0.5762.3
content-class: urn:content-classes:message
Message-ID: <FC169E059D1A0442A04C40F86D9BA7600C6122@itdomain003.itdomain.net.au>
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
From: "Robert Collins" <robert DOT collins AT itdomain DOT com DOT au>
To: "Ton van Overbeek" <tvoverbe AT cistron DOT nl>, <cygwin-apps AT cygwin DOT com>
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id g4K17jE24344


> -----Original Message-----
> From: Ton van Overbeek [mailto:tvoverbe AT cistron DOT nl] 
> Sent: Monday, May 20, 2002 3:26 AM

> 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.

It's not, it alters the default install logic, so you'll be getting the
wrong version by default when you select install at a category level or
click on a pacakage. ('If (installed)' means that packages won't install
on the first click, which is wrong.)

The correct test is:
(desired->bin.sites.number() || desired->bin.Cached())

i.e. if there are download sites that the desired package can come from
or it's known to be cached then we should turn bin on. This also catches
another bug, where reinstall was a valid choice for a installed package
on a local install, regardless of package availability. Thank you for
tracking down the specific location though - that saved me quite some
time.

The fix I'll be committing is below. It makes a source only package
install the source by default in addition to the bug fix above. I also
noticed another minor bug when iterating through lots of packges
locally.

Rob

Index: package_meta.cc
===================================================================
RCS file: /cvs/cygwin-apps/setup/package_meta.cc,v
retrieving revision 2.22
diff -u -p -r2.22 package_meta.cc
--- package_meta.cc	4 May 2002 04:26:01 -0000	2.22
+++ package_meta.cc	20 May 2002 01:04:40 -0000
@@ -318,8 +318,14 @@ packagemeta::set_action (packageversion 
 	}
       return;
     }
-  else if (desired == installed
-	   && (!installed || !(installed->binpicked ||
installed->srcpicked)))
+  else if (desired == installed &&
+	   (!installed || 
+	    // neither bin nor source are being installed
+	    (!(installed->binpicked || installed->srcpicked) &&
+	     // bin or source are available
+	     ((installed->bin.sites.number() || desired->bin.Cached())
||
+ 	      (installed->src.sites.number() ||
desired->src.Cached()))))
+	   )
     /* Install the default trust version - this is a 'reinstall' for
installed
        * packages */
     {
@@ -328,7 +334,10 @@ packagemeta::set_action (packageversion 
       desired = default_version;
       if (desired)
 	{
-	  desired->binpicked = 1;
+	  if (desired->bin.sites.number() || desired->bin.Cached())
+	    desired->binpicked = 1;
+	  else
+	    desired->srcpicked = 1;
 	  return;
 	}
     }
@@ -375,7 +384,10 @@ packagemeta::set_action (packageversion 
 	  if (n <= versions.number ())
 	    {
 	      desired = versions[n];
-	      desired->srcpicked = source;
+	      if (desired->src.sites.number() || desired->src.Cached())
+		desired->srcpicked = source;
+	      else
+		desired->srcpicked = 0;
 	      return;
 	    }
 	}

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019