public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
* [patch] - setup.exe --mirror-list option
@ 2007-07-18 19:11 Hicks, Jerry - ACD
  2007-07-27 15:49 ` [PATCH] - setup.exe --mirror-list option (nudge, nudge) Hicks, Jerry - ACD
  0 siblings, 1 reply; 4+ messages in thread
From: Hicks, Jerry - ACD @ 2007-07-18 19:11 UTC (permalink / raw)
  To: cygwin-apps

[-- Attachment #1: Type: text/plain, Size: 1452 bytes --]

Hi,

I've been setting up a package server that does not have direct internet
connectivity.

Regardless of what I tried, I was unable to keep it from attempting to
contact cygwin.com to retrieve the mirror list.   Upon inspection I
found that the URL for the mirror list appears to be hardcoded into the
.rc file.

I suppose there are good reasons for that in the usual case but I needed
to be able to override it.

Follows is a simple hack to allow a '--mirror-list' option which allows
one to specify where to pick up the mirror list.   I believe it might be
useful to others.

If there is a method of achieving this otherwise [or a reason why it's
stupid :-)]  I would appreciate a heads-up.

Cheers,

Jerry Hicks


*****************************************************************
This e-mail and any files transmitted with it may be proprietary 
and are intended solely for the use of the individual or entity to 
whom they are addressed. If you have received this e-mail in 
error please notify the sender. Please note that any views or
opinions presented in this e-mail are solely those of the author 
and do not necessarily represent those of ITT Corporation. The 
recipient should check this e-mail and any attachments for the 
presence of viruses. ITT accepts no liability for any damage 
caused by any virus transmitted by this e-mail.
*******************************************************************
\r

[-- Attachment #2: site.cc.diff --]
[-- Type: application/octet-stream, Size: 2059 bytes --]

? .deps
? .libs
? Makefile
? config.cache
? config.log
? config.status
? inilex.cc
? iniparse.cc
? iniparse.h
? libtool
? setup.log
? setup.log.full
? setup_version.c
? site.cc.diff
? csu_util/.deps
? csu_util/.dirstamp
? libgetopt++/.libs
? libgetopt++/Makefile
? libgetopt++/config.log
? libgetopt++/config.status
? libgetopt++/libgetopt++.la
? libgetopt++/libtool
? libgetopt++/include/autoconf.h
? libgetopt++/include/stamp-h1
? libgetopt++/src/.deps
? libgetopt++/src/.dirstamp
? libgetopt++/src/BoolOption.lo
? libgetopt++/src/GetOption.lo
? libgetopt++/src/Option.lo
? libgetopt++/src/OptionSet.lo
? libgetopt++/src/StringOption.lo
? libgetopt++/tests/.deps
? libmd5-rfc/.deps
? libmd5-rfc/.dirstamp
? tests/.deps
? tests/Makefile
Index: site.cc
===================================================================
RCS file: /cvs/cygwin-apps/setup/site.cc,v
retrieving revision 2.43
diff -u -r2.43 site.cc
--- site.cc	15 Apr 2006 21:21:25 -0000	2.43
+++ site.cc	18 Jul 2007 18:59:43 -0000
@@ -99,6 +99,7 @@
 SiteList dropped_site_list;
 
 StringOption SiteOption("", 's', "site", "Download site", false);
+StringOption MirrorListOption("", 'm', "mirror-list", "Mirrors list", false);
 
 /* XXX make into a singleton? */
 static SiteSetting ChosenSites;
@@ -307,9 +308,19 @@
       {
 	log (LOG_BABBLE) << "Cached mirror list unavailable" << endLog;
       }
-    if (LoadString (h, IDS_MIRROR_LST, mirror_url, sizeof (mirror_url)) <= 0)
-      return 1;
-    string mirrors = get_url_to_string (mirror_url, owner);
+    string mirrors = "";
+    string MirrorListOptionString = MirrorListOption;
+    if(MirrorListOptionString.size())
+      {
+	strncpy(mirror_url, MirrorListOptionString.c_str(), sizeof(mirror_url));
+        mirrors = get_url_to_string (mirror_url, owner);
+      }
+    if(!mirrors.size())
+      {
+        if (LoadString(h, IDS_MIRROR_LST, mirror_url, sizeof(mirror_url)) <= 0)
+          return 1;
+        mirrors = get_url_to_string (mirror_url, owner);
+      }
     if (mirrors.size())
       {
 	cache_needs_writing = true;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] - setup.exe --mirror-list option  (nudge, nudge)
  2007-07-18 19:11 [patch] - setup.exe --mirror-list option Hicks, Jerry - ACD
@ 2007-07-27 15:49 ` Hicks, Jerry - ACD
  2007-07-27 22:28   ` Christopher Faylor
  0 siblings, 1 reply; 4+ messages in thread
From: Hicks, Jerry - ACD @ 2007-07-27 15:49 UTC (permalink / raw)
  To: cygwin-apps


 No comments?

-----Original Message-----
From: cygwin-apps-owner@cygwin.com [mailto:cygwin-apps-owner@cygwin.com]
On Behalf Of Hicks, Jerry - ACD
Sent: Wednesday, July 18, 2007 3:11 PM
To: cygwin-apps@cygwin.com
Subject: [patch] - setup.exe --mirror-list option

Hi,

I've been setting up a package server that does not have direct internet
connectivity.

Regardless of what I tried, I was unable to keep it from attempting to
contact cygwin.com to retrieve the mirror list.   Upon inspection I
found that the URL for the mirror list appears to be hardcoded into the
.rc file.

I suppose there are good reasons for that in the usual case but I needed
to be able to override it.

Follows is a simple hack to allow a '--mirror-list' option which allows
one to specify where to pick up the mirror list.   I believe it might be
useful to others.

If there is a method of achieving this otherwise [or a reason why it's
stupid :-)]  I would appreciate a heads-up.

Cheers,

Jerry Hicks
*****************************************************************
This e-mail and any files transmitted with it may be proprietary 
and are intended solely for the use of the individual or entity to 
whom they are addressed. If you have received this e-mail in 
error please notify the sender. Please note that any views or
opinions presented in this e-mail are solely those of the author 
and do not necessarily represent those of ITT Corporation. The 
recipient should check this e-mail and any attachments for the 
presence of viruses. ITT accepts no liability for any damage 
caused by any virus transmitted by this e-mail.
*******************************************************************


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] - setup.exe --mirror-list option  (nudge, nudge)
  2007-07-27 15:49 ` [PATCH] - setup.exe --mirror-list option (nudge, nudge) Hicks, Jerry - ACD
@ 2007-07-27 22:28   ` Christopher Faylor
  2007-07-30 15:31     ` Hicks, Jerry - ACD
  0 siblings, 1 reply; 4+ messages in thread
From: Christopher Faylor @ 2007-07-27 22:28 UTC (permalink / raw)
  To: cygwin-apps

On Fri, Jul 27, 2007 at 11:49:39AM -0400, Hicks, Jerry - ACD wrote:
> No comments?

I have two comments but neither is probably anything you want to hear.

1) I don't care if the developers want to consider this patch but since
setup.exe is not supposed to be a generic install utility but I could
see if they they would rather forgo installing it as it doesn't really
provide any functionality which would be useful for the normal user.
New functionality always carries a support burden so these kinds of
features have to be considered with this in mind.

2) It is against site policy for email to be sent with the type of
disclaimer that you are using.  I mention this because very soon we'll
actually be blocking things that look like the disclaimer.

cgf

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [PATCH] - setup.exe --mirror-list option  (nudge, nudge)
  2007-07-27 22:28   ` Christopher Faylor
@ 2007-07-30 15:31     ` Hicks, Jerry - ACD
  0 siblings, 0 replies; 4+ messages in thread
From: Hicks, Jerry - ACD @ 2007-07-30 15:31 UTC (permalink / raw)
  To: cygwin-apps

 

-----Original Message-----
From: cygwin-apps-owner@cygwin.com [mailto:cygwin-apps-owner@cygwin.com]
On Behalf Of Christopher Faylor
Sent: Friday, July 27, 2007 6:29 PM
To: cygwin-apps@cygwin.com
Subject: Re: [PATCH] - setup.exe --mirror-list option (nudge, nudge)

On Fri, Jul 27, 2007 at 11:49:39AM -0400, Hicks, Jerry - ACD wrote:
> No comments?

> I have two comments but neither is probably anything you want to hear.

> 1) I don't care if the developers want to consider this patch
> but since setup.exe is not supposed to be a generic install
> utility but I could see if they they would rather forgo installing
> it as it doesn't really provide any functionality which would be
> useful for the normal user.  New functionality always carries a
> support burden so these kinds of features have to be considered
> with this in mind.

You're right, I didn't want to hear that.  :-)

I suppose it's ok, I can just patch up the .rc file and build a
local customized setup.exe here in perpetuity.

> 2) It is against site policy for email to be sent with the type
> of disclaimer that you are using.  I mention this because very
> soon we'll actually be blocking things that look like the disclaimer.

Yeah, they do that behind my back to all outbound mail so I'm having
that "inflicted" upon me rather than me "using" it.

Thanks for the flame though.

Unsubscribed,

Jerry.
*****************************************************************
This e-mail and any files transmitted with it may be proprietary 
and are intended solely for the use of the individual or entity to 
whom they are addressed. If you have received this e-mail in 
error please notify the sender. Please note that any views or
opinions presented in this e-mail are solely those of the author 
and do not necessarily represent those of ITT Corporation. The 
recipient should check this e-mail and any attachments for the 
presence of viruses. ITT accepts no liability for any damage 
caused by any virus transmitted by this e-mail.
*******************************************************************


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-07-30 15:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-18 19:11 [patch] - setup.exe --mirror-list option Hicks, Jerry - ACD
2007-07-27 15:49 ` [PATCH] - setup.exe --mirror-list option (nudge, nudge) Hicks, Jerry - ACD
2007-07-27 22:28   ` Christopher Faylor
2007-07-30 15:31     ` Hicks, Jerry - ACD

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).