[PATCH 1/4] Add the last element of URL path to site chooser, if interesting.

Jon TURNEY jon.turney@dronecode.org.uk
Fri Apr 8 18:02:00 GMT 2011

On 10/03/2011 14:31, Jon TURNEY wrote:
> On 10/03/2011 08:52, Corinna Vinschen wrote:
>> On Mar  9 12:40, Andy Koppe wrote:
>>> On 29 November 2010 12:57, Corinna Vinschen wrote:
>>>> On Nov 26 13:48, Jon TURNEY wrote:
>>>>> Currently, for example, if I manually add the site http://mirrors.kernel.org/sources.redhat.com/cygwinports/
>>>>> to setup's mirror list, I get two indistinguishable entries named http://mirrors.kernel.org.
>>>>> Furthermore, because the code to ensure the site just added is selected uses the string inside the list control
>>>>> to locate elements, we end up with a random one of those two indistinguishable entries selected (usually the
>>>>> previously existing one).
>>>>> This problem also prevents the selected sites being correctly saved and restored for the next setup run.
>>>>> So, to make the site chooser list entries unique and distinguishable, add the last element of the URL path to
>>>>> the site chooser, if it exists and isn't 'cygwin' (or some other alternatives used by current mirrors)
>>>> That sounds a bit problematic.  So two URLs on the same machine might
>>>> again end up as the same string, undistinguishable, just because they
>>>> both end in the same directory name?  And there are (right now) four
>>>> such directory names, which are treated identically.
>>>> Don't get me wrong.  It's certainly better than what we have today,
>>>> and the full URL is almost unreadable.  Nevertheless, I'd be more happy
>>>> with a solution which fixes this problem even for such border cases...
>>> In the apparent absence of further work on this, it would be nice to
>>> see Jon's patch going in anyway, which most importantly addresses the
>>> issue for Cygwin Ports mirrors, without making anything worse.
>> Jon, are you still working on a different version?
> Still waiting for inspiration to strike :-)
> The patch as it stands is pretty wrong. As I think I wrote elsewhere, the
> proper test for 'interesting' is if the URL originally came from
> http://cygwin.com/mirrors.lst.

I have been doing a bit of musing and tinkering on this, but I think the best
way of solving this problem is to redefine things so it doesn't exist :-)

Rather than having site chooser list combining the functions of (i) choosing
which cygwin.com mirror(s) to download from, and (ii) adding additional sites
to download from, I'd suggest splitting that functionality, so there is (i)
one page for selecting your software sources[*] (which has an Add button to
add user-specified ones) and (ii) a subsequent page for selecting cygwin.com
mirror(s) (which no longer needs an Add button).

As a refinement, step (i), the sources page could be hidden unless an
unchecked-by-default checkbox "Allow me to install software from places other
than cygwin.com mirrors" on some earlier page had been checked.  Having a
separate step (i) might also be a good place to hang any future UI dealing
with key management for those sources.

Currently, mirrors.lst does not contain multiple cygwin.com mirrors with the
same hostname as this would (i) cause them to be indistinguishable in the
mirror list, and (ii) be daft, so the problem of indistinguishable entries in
the site chooser list can now never occur, so we don't need to change how they
are displayed.

This all rather more change than I want to make, though :-(.  But I guess I'll
bestir myself to produce some patches unless someone says this is a terrible idea.

[*] unfortunately, internally in the setup.exe source code, 'source' is used
to mean 'installing from a directory' or 'installing from the internet', so
this needs a better name, but hopefully the sense it is used here is familiar
from yum or apt

More information about the Cygwin-apps mailing list