[packagekit] [PATCH] set packagekitd proxy environment variables

Zhang Qiang qiang.z.zhang at intel.com
Sun Sep 12 21:33:09 PDT 2010


From: xiaoqiang <xiaoqiang at xq-desktop.(none)>

set proxy environment variables which can be used by backend libraries,
such as zypp->curl, which have not any interface to accpet proxy info.
With out this patch zypp backend can't work proxy.

Related meego bug: http://bugs.meego.com/show_bug.cgi?id=746
---
 src/pk-engine.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/src/pk-engine.c b/src/pk-engine.c
index 0f7c410..abd22a2 100644
--- a/src/pk-engine.c
+++ b/src/pk-engine.c
@@ -910,6 +910,12 @@ pk_engine_set_proxy (PkEngine *engine, const gchar *proxy_http, const gchar *pro
 		goto out;
 	}
 
+	/*set proxy environment variables which can be used by backend libraries, such as zypp->curl*/
+	if (proxy_http != NULL)
+		g_setenv ("http_proxy", proxy_http, TRUE);
+	if (proxy_ftp != NULL)
+		g_setenv ("ftp_proxy", proxy_ftp, TRUE);
+
 	/* save sender */
 	sender = dbus_g_method_get_sender (context);
 
-- 
1.7.2.2




More information about the PackageKit mailing list