This is the mail archive of the cygwin-apps 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] make setup mirror list more like web page not just urls


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.

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.

For checking, a short script used awk to do the same when fed with mirrors.lst,
produce lines with the displayed url and sort key separated by a tab, and sort
by the key to produce the displayed urls in the same order as the code should.
The output of the script [was] in the first text attachment to show the
displayed urls in the sorted order.

When this was displayed in setup, some of the urls were cut off by the list box
border, estimated about 3 ems too narrow.
The width of the list box and related controls in res.rc was increased by about
30 pixels, and the position of the Add button moved over the same amount, to
give an acceptable display.

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.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

Attachment: 0001-setup-site.cc-site_list_type-init-display-and-order.patch
Description: Text document


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