From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 105563 invoked by alias); 17 Nov 2017 13:53:14 -0000 Mailing-List: contact cygwin-apps-help@cygwin.com; run by ezmlm Precedence: bulk Sender: cygwin-apps-owner@cygwin.com List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Mail-Followup-To: cygwin-apps@cygwin.com Received: (qmail 105492 invoked by uid 89); 17 Nov 2017 13:53:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,KB_WAM_FROM_NAME_SINGLEWORD,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy=H*r:sk:compute, Hx-spam-relays-external:sk:compute, H*RU:sk:compute, H*F:D*org.uk X-HELO: out4-smtp.messagingengine.com Received: from out4-smtp.messagingengine.com (HELO out4-smtp.messagingengine.com) (66.111.4.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 17 Nov 2017 13:53:10 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 0C78A20861; Fri, 17 Nov 2017 08:53:08 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute6.internal (MEProxy); Fri, 17 Nov 2017 08:53:08 -0500 X-ME-Sender: Received: from [192.168.1.102] (host31-51-207-28.range31-51.btcentralplus.com [31.51.207.28]) by mail.messagingengine.com (Postfix) with ESMTPA id 92F07240F8; Fri, 17 Nov 2017 08:53:07 -0500 (EST) Subject: Re: [PATCH] make setup mirror list more like web page not just urls To: cygwin-apps@cygwin.com References: <09c0dc5b-f975-42a9-a204-b02edef6a3ad@SystematicSw.ab.ca> Cc: Brian Inglis From: Jon Turney Message-ID: Date: Fri, 17 Nov 2017 13:53:00 -0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <09c0dc5b-f975-42a9-a204-b02edef6a3ad@SystematicSw.ab.ca> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2017-11/txt/msg00070.txt.bz2 On 15/11/2017 21:35, Brian Inglis wrote: > 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. Thanks for the patch. Nice idea. I hadn't noticed that this information is in mirrors.lst, but we're failing to use it. > The first change was to prefix the displayed_url member in site.cc > site_list_type::init "constructor" with "area - location - ". The 'real solution' to this would be to drag setup into the present century and use a grid control to present this information. Lots of work, though :( > 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. [...] This code needs to handle manually added URLs with non-FQDNs. Although we give no indication of it in the UI, I think you can also just add a path. Can you test your changes in those cases? It's also a long-standing defect here that if you add two URLs with the same protocol/host, they aren't distinguishable [1] [1] https://cygwin.com/ml/cygwin-apps/2010-11/msg00178.html > 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. Yeah, that's going to need fixing. - If the URL matches one in the list, that item should be selected. - Store area and location so we can populate those fields if it doesn't. Please, please use git-format-patch in future. The patch also has some spurious changes to the mode of the manifest files.