This is the mail archive of the
cygwin-apps
mailing list for the Cygwin project.
[PATCH setup v4 6/6] Display area and location of official mirrors
- From: Ken Brown <kbrown at cornell dot edu>
- To: cygwin-apps at cygwin dot com
- Cc: Brian Inglis <Brian dot Inglis at SystematicSw dot ab dot ca>
- Date: Sun, 10 Dec 2017 12:49:30 -0500
- Subject: [PATCH setup v4 6/6] Display area and location of official mirrors
- Authentication-results: sourceware.org; auth=none
- References: <20171210174930.9960-1-kbrown@cornell.edu>
From: Brian Inglis <Brian.Inglis@SystematicSw.ab.ca>
Mirrors from mirrors.lst have area and location info, which we now
display and add to the sort key. For private mirrors, continue to
display only the (full) URL, but make them sort last.
Change site_list_type::operator== to compare URLs rather than keys,
since the key no longer depends only on the URL.
---
site.cc | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/site.cc b/site.cc
index a1a5e3f..fdf0721 100644
--- a/site.cc
+++ b/site.cc
@@ -207,11 +207,19 @@ site_list_type::site_list_type (const string &_url,
idx = 0;
} while (idx > 0);
key += url;
- if (!from_mirrors_lst)
+
+ if (from_mirrors_lst)
+ {
+ displayed_url = area + " - " + location + " - " + displayed_url;
+ key = area + " " + location + " " + displayed_url;
+ }
+ else
{
/* Display full URL (without trailing slash) */
displayed_url = url;
displayed_url.erase (displayed_url.end () - 1);
+ if (is_mirror)
+ key = "zzzz " + key;
}
}
@@ -244,7 +252,7 @@ site_list_type::operator= (site_list_type const &rhs)
bool
site_list_type::operator == (site_list_type const &rhs) const
{
- return stricmp (key.c_str(), rhs.key.c_str()) == 0;
+ return stricmp (url.c_str(), rhs.url.c_str()) == 0;
}
bool
--
2.15.1