[PATCH setup v4 6/6] Display area and location of official mirrors

Ken Brown kbrown@cornell.edu
Sun Dec 10 17:49:00 GMT 2017


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



More information about the Cygwin-apps mailing list