Helix Updater patch



Sorry to send this to the gnome list, but obviously no one's answering
on the Helix lists.

This patch adds the ability to give a -m parameter to the helix updater
to allow selection of the mirrors.xml file location. This allows you to
perform updates inside a firewall which mirrors helix code's server,
allowing faster updates and saving bandwidth for people behind the
firewall.

This patch was written by a co-worker, Ken Bantoft
<kbantoft@ca.ibm.com>, who has submitted it to the bug tracker, sent it
to Joe Shaw a couple times, even right after I spoke with Joe on IRC.

Can someone please look at this and hopefully apply it to the updater so
that the conspiracy theorists can be at rest? Thanks.

-- 

Steve Fox
http://k-lug.com
--- /home/drfickle/src/RPM/SOURCES/helix-update-0.6/update.c	Sat Aug 19 23:57:42 2000
+++ update.c	Wed Aug 23 14:34:16 2000
@@ -27,15 +27,20 @@
 #include <errno.h>
 
 
+
+
 poptContext ctx;
 char *download_dir = NULL;
 int change_proxy;
+char *with_mirrors_loc = NULL;
 
 const struct poptOption popt_options[] = {
 	{ "download-dir", 'd', POPT_ARG_STRING, &download_dir, 0,
 	  N_("Directory for downloaded files"), N_("DIR") },
 	{ "change-proxy", 'c', POPT_ARG_NONE, &change_proxy, 0,
 	  N_("Change current proxy settings"), N_("URL") },
+	{ "with-mirrors-loc", 'm', POPT_ARG_STRING, &with_mirrors_loc, 0,
+	  N_("Location of mirrors.xml file"), N_("URL") },
 	{ NULL, '\0', 0, NULL, 0 }
 };
 
@@ -1539,10 +1544,10 @@
 } /* got_mirror_done */
 
 static void
-fetch_mirror_listing(void)
+fetch_mirror_listing(char *url)
 {
 	GnomeTransfer *gt;
-	char *url = "http://spidermonkey.helixcode.com/mirrors.xml";
+
 	GByteArray *data = NULL;
 
 	data = g_byte_array_new();
@@ -1566,11 +1571,11 @@
 		
 
 void
-download_mirror_list(void)
+download_mirror_list(char *with_mirrors_loc)
 {
 	int ret;
 
-	fetch_mirror_listing();
+	fetch_mirror_listing(with_mirrors_loc);
 	wait_window = glade_xml_get_widget(gui, "mirror_wait_window");
 	ret = gnome_dialog_run(GNOME_DIALOG(wait_window));
 	if (ret == 0) {
@@ -1715,7 +1720,14 @@
 	}
 	else
 		download_dir = g_strdup("/var/cache/helix-install");
+ 
+       if (!with_mirrors_loc) 
+               with_mirrors_loc = g_strdup("http://spidermonkey.helixcode.com/mirrors.xml");
+        
+               
+ 
 	
+
 	check_for_root();
 	gdk_rgb_init();
 	glade_gnome_init();
@@ -1829,7 +1841,7 @@
 
 	check_proxy_settings();
 
-	download_mirror_list();
+	download_mirror_list(with_mirrors_loc);
 	gtk_main();
 
 	return 0;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]