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 setup v4 6/6] Display area and location of official mirrors


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


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