public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
From: Ken Brown <kbrown@cornell.edu>
To: cygwin-apps@cygwin.com
Subject: Re: [PATCH] make setup mirror list more like web page not just urls
Date: Fri, 17 Nov 2017 13:48:00 -0000	[thread overview]
Message-ID: <d99921d9-5e12-4b56-484a-0de2071207e5@cornell.edu> (raw)
In-Reply-To: <09c0dc5b-f975-42a9-a204-b02edef6a3ad@SystematicSw.ab.ca>

On 11/15/2017 4:35 PM, Brian Inglis wrote:
> Hi folks,
> 
> [reposted without text attachment to see if patch gets thru]
> 
> Working on a FAST_CWD FAQ, looking at the Setup mirror site page and the web
> page, I wondered if we could usefully add the mirrors.lst region and territory
> (called area and location in the code) to the Setup display, to avoid users
> having to refer to the web page to find out where mirrors are based geographically.

I think this is a good idea in principle, but it still needs some work.

> The first change was to prefix the displayed_url member in site.cc
> site_list_type::init "constructor" with "area - location - ".
> 
> The sort key was the mirror url host name with the domain components in reverse
> order to sort non-country TLDs together before CC TLDs.
> The code tested for TLD length == 3 to distinguish between CC and non-CC TLDs,
> as this code is over 10 years old and there were only the original com, edu,
> gov, mil, net, org non-CC domains, before other gTLDs were added.
> That test was changed to handle all gTLDs with length >= 3, to prefix area and
> location to the sort key member, reverse the domain components in the servername
> field instead of the url host, and suffix the url protocol prefix to keep the
> key unique where sites offer both ftp and http mirrors, rather than the whole
> url in the original.

Adding the protocol to the key instead of the full url isn't enough to 
guarantee uniqueness of the key.  Users can add their own sites for 
which that fails.  Also, you shouldn't be relying on the servername 
field being filled in.  For example, the function 
SiteSetting::registerSavedSite() explicitly constructs a site 'tempSite' 
that has an empty servername.

> The required patch is attached for discussion: some may not like the display of
> the default mirror from /etc/setup/setup.rc last_mirror, which appears in the
> list as " - - url", as the other mirrors.lst fields are not currently saved
> under last_mirror, and more work may be needed to improve this.

If the saved url corresponds to a site in the list, I think setup should 
recognize this rather than listing the same site again as " - - url".

Ken

  reply	other threads:[~2017-11-17 13:48 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-15 21:35 Brian Inglis
2017-11-17 13:48 ` Ken Brown [this message]
2017-11-19 20:24   ` Ken Brown
2017-11-17 13:53 ` Jon Turney
2017-11-20 21:30   ` Brian Inglis
2017-11-20 22:59     ` Ken Brown
2017-11-20 23:02       ` Ken Brown
2017-11-22 16:48         ` Brian Inglis
2017-11-22 16:42       ` Brian Inglis
2017-11-23 21:07         ` Ken Brown
2017-11-24  6:23           ` Brian Inglis
2017-11-24 16:21             ` Ken Brown
2017-11-24 21:48               ` Brian Inglis
2017-11-25 16:49                 ` Ken Brown
2017-11-25 17:44                   ` Brian Inglis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d99921d9-5e12-4b56-484a-0de2071207e5@cornell.edu \
    --to=kbrown@cornell.edu \
    --cc=cygwin-apps@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).