Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 300651

Summary: Layman requires a proxy to be defined in layman.cfg - Why? It's already in make.conf
Product: Gentoo Linux Reporter: James Broadhead <jamesbroadhead>
Component: Current packagesAssignee: Sebastian Pipping <sping>
Status: RESOLVED FIXED    
Severity: minor CC: anton.bugs
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description James Broadhead 2010-01-12 02:18:32 UTC
There is no need for layman to need the proxy to be defined in layman.cfg - it's just another file that laptop users have to edit if they move around. 

Portage already has a mechanism for defining proxies - in make.conf. Layman should read proxy information from there. 

Reproducible: Always
Comment 1 Sebastian Pipping gentoo-dev 2010-01-12 13:50:45 UTC
I'm not sure if everyone would agree to it. What if someone wants different proxy config for layman than portage? Also, isn't proxy information something that you have to set up at many different places anyway? What about your browser for instance?
Comment 2 James Broadhead 2010-01-12 15:15:42 UTC
(In reply to comment #1)
> I'm not sure if everyone would agree to it. What if someone wants different
> proxy config for layman than portage? 

Can you describe a situation where this would be the case? I can't think of any. If you feel strongly that people may want this, 
import_proxy_from_make.conf=True or something could be an option. I still can't think why though. 


> Also, isn't proxy information something
> that you have to set up at many different places anyway? What about your
> browser for instance?

It is, but "it's the status quo" isn't a great reason not to improve things. I get hit by proxy changing twice a week, moving my laptop around. There's a list of files, including my browser settings which must be changed each time I change location. Cutting that list down by even a single file would be a good thing (even beyond this, the source control tools that layman calls also need proxy info set in config files, I think git is the only one which honours environment variables).

Ideally, programs would read $HTTP_PROXY, which I can set/unset as neccessary, but I really think that as layman is a portage tool, it should be aware of system settings set for portage. 

Comment 3 Sebastian Pipping gentoo-dev 2010-01-12 16:16:09 UTC
(In reply to comment #2)
> import_proxy_from_make.conf=True or something could be an option.

I like that idea, but ...

I'm quite busy and my heart doesn't really beat for proxy support.  Any chance you could make a patch for me?
Comment 4 Anton Bolshakov 2010-01-13 05:37:36 UTC
What is the recommended way for specifying proxy settings?..
The bug #28094 (wontfix) says (HTTP_PROXY != http_proxy) which is even more confusing.

I agree, it's not logical changing layman.cfg, wgetrc, make.conf if you just switched to another network. In the same time it must be way to overwrite global setting if necessary.

So how about using config settings as high priority and (if it is not set) $http_proxy as a second?

P.S. I like the way how chrome specified $HTTP variables:
http://code.google.com/p/chromium/wiki/LinuxProxyConfig
Comment 5 Christian Ludwig 2010-01-13 21:32:27 UTC
Wow, normally I only need to change the http_proxy environment variable when changing networks. Everything derives from it.

From my point of view, Layman honors the environment variable http_proxy already, if the "proxy" option in layman.cfg is _not_ set. You will need to set this environment variable for Portage anyway without the need for any additional config variables in make.conf, since Portage uses wget (by default) which honors that variable, too. Does that work for you?

If that works, maybe there should at least be a clarifying comment in layman.cfg.
Comment 6 Sebastian Pipping gentoo-dev 2010-02-26 18:31:09 UTC
Can you re-summarize what you want me to do?  I'm a bit lost.
Comment 7 James Broadhead 2010-02-26 22:18:09 UTC
(In reply to comment #6)
> Can you re-summarize what you want me to do?  I'm a bit lost.
> 

I had a go at implementing a change as I described in the original report, and discovered that comment #5 is right - layman honours the http_proxy environment variable. (unless otherwise specified in layman.cfg)

If this were made clear in the default layman.cfg file, I think that that would be enough. 

eg.
# Proxy support
# If unset, layman will ues the http_proxy environment variable.
#proxy  : http://[user:pass@]www.my-proxy.org:3128
Comment 8 Sebastian Pipping gentoo-dev 2010-02-26 23:47:48 UTC
(In reply to comment #7)
> If this were made clear in the default layman.cfg file, I think that that would
> be enough. 
> 
> eg.
> # Proxy support
> # If unset, layman will ues the http_proxy environment variable.
> #proxy  : http://[user:pass@]www.my-proxy.org:3128

Now fixed as suggested, closing.
http://layman.git.sourceforge.net/git/gitweb.cgi?p=layman/layman;a=commitdiff;h=ff2e47c9682bbd07e821110a34a67861cce2168e