public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
* [PATCH setup] Don't always be silent about failing to fetch mirrors.lst
@ 2020-02-01 17:18 Jon Turney
  0 siblings, 0 replies; only message in thread
From: Jon Turney @ 2020-02-01 17:18 UTC (permalink / raw)
  To: cygwin-apps; +Cc: Jon Turney

Currently, if there is no cached mirrors list (e.g. this is the first
run), and we're behind some kind of proxy which doesn't let us through,
we'll try to fetch mirrors.lst, silently fail, and present the user with
an empty mirror list.

Instead, report failure to fetch mirror.lst if we don't have a cached
mirrored list (and a mirror isn't being explicitly specified with
'--only-site --site <someurl>').
---
 res.rc     | 1 +
 resource.h | 1 +
 site.cc    | 6 +++++-
 3 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/res.rc b/res.rc
index 654a9e7..bd154fc 100644
--- a/res.rc
+++ b/res.rc
@@ -608,4 +608,5 @@ BEGIN
       "will be nothing to install.\n\nPress OK if that's what you wanted\nor Cancel to choose a different directory."
     IDS_ELEVATED       "Hand installation over to elevated child process."
     IDS_INSTALLEDB_VERSION "Unknown INSTALLED.DB version"
+    IDS_NO_MIRROR_LST  "Could not download mirror sites list"
 END
diff --git a/resource.h b/resource.h
index 852bdc0..a98924c 100644
--- a/resource.h
+++ b/resource.h
@@ -41,6 +41,7 @@
 #define IDS_DOWNLOAD_INCOMPLETE_EXIT      141
 #define IDS_QUERY_CORRUPT                 142
 #define IDS_TRUSTSYNC_TOOLTIP             143
+#define IDS_NO_MIRROR_LST                 144
 
 // Dialogs
 
diff --git a/site.cc b/site.cc
index ccffef5..46ec53a 100644
--- a/site.cc
+++ b/site.cc
@@ -341,7 +341,11 @@ get_site_list (HINSTANCE h, HWND owner)
   else
     {
       if (!cached_mirrors[0])
-	Log (LOG_BABBLE) << "Defaulting to empty mirror list" << endLog;
+        {
+          if (!OnlySiteOption)
+            note(owner, IDS_NO_MIRROR_LST);
+          Log (LOG_BABBLE) << "Defaulting to empty mirror list" << endLog;
+        }
       else
 	{
 	  mirrors = cached_mirrors;
-- 
2.21.0

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-02-01 17:18 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-01 17:18 [PATCH setup] Don't always be silent about failing to fetch mirrors.lst Jon Turney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).