Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-Id: <422F439D.4000203@design.mxim.com> Date: Wed, 09 Mar 2005 18:42:37 +0000 From: jasonp AT design DOT mxim DOT com (Jason Pearce) User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) Mime-Version: 1.0 To: Cygwin List Subject: no-mirror patch for setup.exe Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Note-from-DJ: This may be spam I want to use setup.exe behind a firewall where it cant see the list of mirrors. This patch creates a -m option for no-mirror. In this case the application will not try to get a list of sites and the user is obliged to provide a valid site with the existing -s switch. BTW - The -h help option doesn't seem to work. Regards, Jason Index: site.cc =================================================================== RCS file: /cvs/cygwin-apps/setup/site.cc,v retrieving revision 2.35 diff -u -p -r2.35 site.cc --- site.cc 29 Dec 2004 12:38:04 -0000 2.35 +++ site.cc 9 Mar 2005 18:39:22 -0000 @@ -62,6 +62,7 @@ SitePage::SitePage () } #include "getopt++/StringOption.h" +#include "getopt++/BoolOption.h" #include "UserSettings.h" using namespace std; @@ -70,6 +71,7 @@ SiteList site_list; SiteList all_site_list; StringOption SiteOption("", 's', "site", "Download site", false); +static BoolOption NoMirrorOption (false, 'm', "no-mirror", "Don't download mirror sites"); /* XXX make into a singleton? */ static SiteSetting ChosenSites; @@ -194,6 +196,14 @@ static int get_site_list (HINSTANCE h, HWND owner) { char mirror_url[1000]; + bool NoMirror = NoMirrorOption; + + if (NoMirror){ + /* Don't bother with getting a list of sites, the user must specify + a site via the -s switch. But this prevents failure if behind firewall + and can't access the mirror list */ + return 0; + } if (LoadString (h, IDS_MIRROR_LST, mirror_url, sizeof (mirror_url)) <= 0) return 1; -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Problem reports: http://cygwin.com/problems.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/