[PATCH setup 1/3] Fix selecting sites added to the download site list box
Fix selecting sites added to the download site list box which have the same protocol and hostname as an offical cygwin mirror. If I add the site http://mirrors.kernel.org/sources.redhat.com/cygwinports/ to setup's mirror list, using the GUI or --site option, I get two indistinguishable entries named http://mirrors.kernel.org in the mirror list box. Because PopulateListBox() uses the displayed string in the list control to locate the itesm to select, we end up with a random one of those two indistinguishable entries selected (usually the previously existing one). Even if you manually correct the selection, the same problem will re-occur when the selected sites are saved and restored on the next setup run. Fix this by selecting by the index in the all_site_list vector, instead of by displayed text. 2014-04-19 Jon TURNEY jon.tur...@dronecode.org.uk * site.cc (PopulateListBox): Select listbox items by finding the index of the item with a matching full URL, not by LB_FINDSTRING which does an inexact match on the displayed URL. Signed-off-by: Jon TURNEY jon.tur...@dronecode.org.uk --- site.cc | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/site.cc b/site.cc index 2ed5d7b..e7d4113 100644 --- a/site.cc +++ b/site.cc @@ -637,10 +637,12 @@ SitePage::PopulateListBox () for (SiteList::const_iterator n = site_list.begin (); n != site_list.end (); ++n) { - int index = SendMessage (listbox, LB_FINDSTRING, (WPARAM) - 1, - (LPARAM) n-displayed_url.c_str()); - if (index != LB_ERR) - { + SiteList::iterator i = find (all_site_list.begin(), + all_site_list.end(), *n); + if (i != all_site_list.end()) +{ + int index = i - all_site_list.begin(); + // Highlight the selected item SendMessage (listbox, LB_SELITEMRANGE, TRUE, (index 16) | index); // Make sure it's fully visible -- 1.8.5.5
[PATCH setup 0/3] Setup download site list fixes
A few patches to improve the way that the download site list works in setup. I don't really like the heuristic approach taken in patch [3/3], which was discussed a bit in Nov 2010, but nothing better has emerged from my bikeshed in the meantime. Jon TURNEY (3): Fix selecting sites added to the download site list box Correctly make displayed_url for non-FQDNs Add the last element of URL path to site chooser, if interesting. site.cc | 36 +++- 1 file changed, 31 insertions(+), 5 deletions(-) -- 1.8.5.5
[PATCH setup 2/3] Correctly make displayed_url for non-FQDNs
Fix the logic for identifying protocol and site name part of the URL to find the first '/' after a '//', rather than the first '/' after a '.', to handle sitenames which aren't FQDNs correctly This makes non-FQDNs added to the mirror list display correctly. 2010-11-26 Jon TURNEY jon.tur...@dronecode.org.uk * site.cc (init): Handle sitenames which aren't FQDNs correctly. Signed-off-by: Jon TURNEY jon.tur...@dronecode.org.uk --- site.cc | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/site.cc b/site.cc index e7d4113..48ec0aa 100644 --- a/site.cc +++ b/site.cc @@ -150,8 +150,11 @@ site_list_type::init (const string _url, const string _servername, url.append(/); /* displayed_url is protocol and site name part of url */ - displayed_url = url.substr (0, url.find (/, url.find (.))); + string::size_type path_offset = url.find (/, url.find (//) + 2); + displayed_url = url.substr(0, path_offset); + /* the sorting key is hostname components in reverse order (to sort by country code) + plus the url (to ensure uniqueness) */ key = string(); string::size_type last_idx = displayed_url.length () - 1; string::size_type idx = url.find_last_of(./, last_idx); -- 1.8.5.5
[PATCH setup 3/3] Add the last element of URL path to site chooser, if interesting.
If I add the site http://mirrors.kernel.org/sources.redhat.com/cygwinports/ to setup's mirror list, using the GUI or --site option, I get two indistinguishable entries named http://mirrors.kernel.org in the mirror list box. So, to make the site chooser list entries more 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) As Corinna pointed out in Nov 2010, there is still a corner case of URLs which share protocol, hostname and the last element of the URL path being indistinguishable. Additionally, it will need updating for any new mirrors which don't use one of the expected strings for the last path element in the URL. 2014-04-19 Jon TURNEY jon.tur...@dronecode.org.uk * site.cc (init): If interesting, show the last element of URL, as well as the protocol and sitename in the site chooser. Signed-off-by: Jon TURNEY jon.tur...@dronecode.org.uk --- site.cc | 21 + 1 file changed, 21 insertions(+) diff --git a/site.cc b/site.cc index 48ec0aa..70f6303 100644 --- a/site.cc +++ b/site.cc @@ -173,6 +173,27 @@ site_list_type::init (const string _url, const string _servername, idx = 0; } while (idx 0); key += url; + + /* add last element of url if it exists, and isn't cygwin to displayed_url */ + if (path_offset+1 url.length()) +{ + string url_path = url.substr(path_offset+1); + + /* trim any trailing / */ + if (url_path.at(url_path.length()-1) == '/') +url_path.erase(url_path.length()-1); + + /* add the last path element, if it exists, and isn't cygwin + (or some aliases used by existing sites) */ + string::size_type pos = url_path.rfind('/'); + string lpe = url_path.substr(pos+1); + if ((pos != string::npos) (lpe.compare(cygwin) != 0) + (lpe.compare(cygwin.com) != 0) (lpe.compare(cygwin32) != 0) + (lpe.compare(gnu-win32) != 0)) +{ + displayed_url.append( ( + lpe + )); +} +} } site_list_type::site_list_type (const string _url, -- 1.8.5.5
Re: [PATCH setup 3/3] Add the last element of URL path to site chooser, if interesting.
On Mon, Apr 21, 2014 at 12:16:27PM +0100, Jon TURNEY wrote: If I add the site http://mirrors.kernel.org/sources.redhat.com/cygwinports/ to setup's mirror list, using the GUI or --site option, I get two indistinguishable entries named http://mirrors.kernel.org in the mirror list box. So, to make the site chooser list entries more 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) As Corinna pointed out in Nov 2010, there is still a corner case of URLs which share protocol, hostname and the last element of the URL path being indistinguishable. Additionally, it will need updating for any new mirrors which don't use one of the expected strings for the last path element in the URL. 2014-04-19 Jon TURNEY jon.tur...@dronecode.org.uk * site.cc (init): If interesting, show the last element of URL, as well as the protocol and sitename in the site chooser. Signed-off-by: Jon TURNEY jon.tur...@dronecode.org.uk --- site.cc | 21 + 1 file changed, 21 insertions(+) diff --git a/site.cc b/site.cc index 48ec0aa..70f6303 100644 --- a/site.cc +++ b/site.cc @@ -173,6 +173,27 @@ site_list_type::init (const string _url, const string _servername, idx = 0; } while (idx 0); key += url; + + /* add last element of url if it exists, and isn't cygwin to displayed_url */ + if (path_offset+1 url.length()) +{ + string url_path = url.substr(path_offset+1); + + /* trim any trailing / */ + if (url_path.at(url_path.length()-1) == '/') +url_path.erase(url_path.length()-1); + + /* add the last path element, if it exists, and isn't cygwin + (or some aliases used by existing sites) */ + string::size_type pos = url_path.rfind('/'); + string lpe = url_path.substr(pos+1); + if ((pos != string::npos) (lpe.compare(cygwin) != 0) + (lpe.compare(cygwin.com) != 0) (lpe.compare(cygwin32) != 0) + (lpe.compare(gnu-win32) != 0)) +{ + displayed_url.append( ( + lpe + )); +} +} } I'd actually be ok with just displaying the whole URL even if it ends with Cygwin. Is there a reason not to do that? cgf
Re: [64bit] python3 vs. threads
Hi Folks, On Tue, Oct 15, 2013 at 8:28 PM, Jason Tishler ja...@tishler.net wrote: Yaakov, On Wed, Oct 02, 2013 at 11:53:55PM -0500, Yaakov (Cygwin/X) wrote: On 2013-08-15 12:50, Yaakov (Cygwin/X) wrote: On 2013-08-15 10:32, Corinna Vinschen wrote: Jason? Is there any chance you could pick this up? I NMU'd both python and python3 for x86_64 earlier this week as a prerequisite for the GNOME 3.8 update; so far they're both working well. I just added a -3 with a patch for the uuid module: http://bugs.python.org/issue18784 Jason, any chance of matching updates for x86? Yes, but I would like to work on getting my 64-bit environment set up first. Jason Thanks for all of your work on this, but I don't think the Python uuid issue is fixed yet. The Python interpreter relies on the stubs in libuuid-devel, and this dependency is not indicated in the setup.ini file for Python or Python 3 (this is an issue for both codes). Let me know if there's anything I can do to help! -Aron References: https://sourceware.org/ml/cygwin/2014-04/msg00375.html https://stackoverflow.com/questions/18947163/uuid-python-import-fails-on-cygwin-64bits https://github.com/kennethreitz/requests/issues/1547 https://github.com/pypa/pip/issues/1448
Re: [PATCH setup 3/3] Add the last element of URL path to site chooser, if interesting.
On 21/04/2014 15:10, Christopher Faylor wrote: On Mon, Apr 21, 2014 at 12:16:27PM +0100, Jon TURNEY wrote: If I add the site http://mirrors.kernel.org/sources.redhat.com/cygwinports/ to setup's mirror list, using the GUI or --site option, I get two indistinguishable entries named http://mirrors.kernel.org in the mirror list box. So, to make the site chooser list entries more 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) As Corinna pointed out in Nov 2010, there is still a corner case of URLs which share protocol, hostname and the last element of the URL path being indistinguishable. Additionally, it will need updating for any new mirrors which don't use one of the expected strings for the last path element in the URL. I'd actually be ok with just displaying the whole URL even if it ends with Cygwin. Is there a reason not to do that? Last time this was discussed [1], I think you felt that the current site list and dialog box is too small to display the full URL usefully. [1] http://cygwin.com/ml/cygwin-apps/2010-11/msg00134.html
Re: remaining missing packages in 64-bit release
Hi all, About missing packages in 64-bits, I have just released Varnish 3.0.5 at 32 and 64 bits. Regards. El 14/07/2013 7:40, Yaakov (Cygwin/X) escribió: On 2013-07-13 21:38, Christopher Faylor wrote: On Sat, Jul 13, 2013 at 09:44:40PM -0400, Andrew Schulman wrote: There are of course other packages that could be called missing because they haven't been ported to x86_64 yet, and other packages that depend on them can't be released until they are. Ah, good point. I'll check tomorrow and make a more comprehensive list. Attached. Yaakov --- This email is free from viruses and malware because avast! Antivirus protection is active. http://www.avast.com