? bakString++.cc ? fix1String++.cc ? save-setup-diffs.txt ? temp-extra Index: ChangeLog =================================================================== RCS file: /cvs/cygwin-apps/setup/ChangeLog,v retrieving revision 2.578 diff -p -u -r2.578 ChangeLog --- ChangeLog 1 Aug 2007 00:09:18 -0000 2.578 +++ ChangeLog 1 Feb 2008 02:26:00 -0000 @@ -1,3 +1,9 @@ +2008-02-01 Vincent Privat + + * net.cc (OnInit): New StringOption (ProxyOption) + This new option (-p) allows to call setup.exe with a proxy + in its command-line arguments. + 2007-07-31 Brian Dessent * ini.cc (do_remote_ini): Fix crash due to double free of ini_file. Index: net.cc =================================================================== RCS file: /cvs/cygwin-apps/setup/net.cc,v retrieving revision 2.17 diff -p -u -r2.17 net.cc --- net.cc 4 May 2005 14:52:34 -0000 2.17 +++ net.cc 1 Feb 2008 02:26:00 -0000 @@ -28,16 +28,20 @@ static const char *cvsid = #include "win32.h" #include #include +#include #include "dialog.h" #include "resource.h" #include "netio.h" #include "msg.h" +#include "getopt++/StringOption.h" #include "propsheet.h" #include "threebar.h" #include "ConnectionSetting.h" extern ThreeBarProgressPage Progress; +static StringOption ProxyOption ("", 'p', "proxy", "HTTP/FTP proxy (host:port)", false); + static int rb[] = { IDC_NET_IE5, IDC_NET_DIRECT, IDC_NET_PROXY, 0 }; static ConnectionSetting theSetting; static bool doing_loading = false; @@ -110,9 +114,24 @@ void NetPage::OnInit () { HWND h = GetHWND (); + std::string proxyString (ProxyOption); if (!NetIO::net_method) NetIO::net_method = IDC_NET_DIRECT; + + if (proxyString.size ()) + { + unsigned int pos = proxyString.find_last_of (':'); + if ((pos > 0) && (pos < (proxyString.size () - 1))) + { + NetIO::net_method = IDC_NET_PROXY; + NetIO::net_proxy_host = strdup (proxyString.substr (0, pos).c_str ()); + std::string portString = proxyString.substr (pos + 1, proxyString.size () - (pos + 1)); + std::istringstream iss (portString, std::istringstream::in); + iss >> NetIO::net_proxy_port; + } + } + load_dialog (h); CheckIfEnableNext();