[packagekit] [PATCH] set packagekitd proxy environment variables

Richard Hughes hughsient at gmail.com
Mon Sep 13 01:16:39 PDT 2010


On 13 September 2010 05:33, Zhang Qiang <qiang.z.zhang at intel.com> wrote:
> 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.

Proxy is a per-user definition, rather than per-system. I guess this
distinction isn't important on meego so much, but it certainly is on
the desktop. PackageKit goes to great pains to preserve the per-user
proxy data, even for multiply logged in users. As such, it's wrong to
set this environment variable in the engine, as this will be cleared
as soon as user proxy data is set.

The correct way to do this would be to use pk_backend_get_proxy_http()
in the zypp backend transaction function start or _init() function,
and use a zypp_set_proxy_http() type function. Relying on a
environment variable being propagated kinda sucks from a library
design point of view, if I'm being honest. But, from a "getting it
working" point of view, certainly setting the http_proxy environment
variable in the zypp backend is a fairly good way to solve this.

I hope that helps.

Richard.



More information about the PackageKit mailing list