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

Re: use LB_APT_HTTP_PROXY in debootstrap and for udebs



On Thu, May 31, 2012 at 12:04 PM, Daniel Baumann
<daniel.baumann@progress-technologies.net> wrote:
> On 05/31/2012 11:49 AM, Rui Miguel P. Bernardo wrote:
>> apt-cacher users don't have http_proxy in their environment and it
>> doesnt work for them.
>
> so what do they have then?

I meant that I don't have http_proxy in my /etc/profile nor in /etc/bash.bashrc.
Having it set there with apt-cacher would make everything use http_proxy with
apt-cacher, and apt-cacher is not squid proxy.

> why don't you just set the chroot mirrors to your apt-cacher instance
> and be done with it like everyone that uses apt-cacher{-ng} does?

Because I remember getting problems like in
http://lists.debian.org/debian-live/2011/11/msg00137.html

>> But if I add the following code in lb_bootstrap_debootstrap and
>> lb_binary_debian-installer:
>>
>> if [ -n "${http_proxy}" ]
>> then
>>        export http_proxy
>> fi
>
> for sub-shells and forks, there is no difference between a set variable
> and an exported variable, so this does not make sense.

I agree. It's very confusing why this happens. But it does here. Could
anybody confirm:
if not exporting http_proxy it will not be used in bootstrap and
debian-installer stage?

>> An alternative to changing the code may be a reference in live-manual or
>> lb_config man page about the fact that http_proxy must be set and exported
>
> i remembered now why we added the apt proxy options to only set them in
> the chroot, so i'm reverting that change in debian-next that adds
> http_proxy/ftp_proxy to config/common.

And what was that reason, please? So everyone understands why.

>
> the correct way of doing this is to a) use proper chroot mirror values
> and b) matching apt-*-proxy values for using these apt pseudo proxies
> within the chroot.

Doing so made me hit problems like
http://lists.debian.org/debian-live/2011/11/msg00137.html in the past.
I'd like to avoid it.

I've re-read the lb_config man page and it says:

       --apt-http-proxy URL
           sets the http proxy to be used by apt. By default,  this  is  empty
           but  if  the  host  has  the  environment  variable http_proxy set,
           apt-http-proxy gets automatically set to the value of http_proxy.

The confusion about http_proxy and apt-cacher and proxy problems made me
ignore this manual recommendation about http_proxy over the time. Sudo
not preserving env vars also must have helped me to ignore http_proxy
value. I'm going to add something like Defaults env_keep += "http_proxy"
to sudoers and see what happens later.

For now I've tried to build with a "reverted" lb_config and without any patch,
and with apt-cacher and exporting http_proxy. Apparently all it's working as
it should now. debootstrap and debian-installer stages included are downloading
from apt-cacher.

I'm going to let this settle for now and export http_proxy every time I use
live-build. Or maybe I'll change for squid. I'll return into this if I
get problems
with a not standard debian build.

I just wanted help improving it about this problem I was having. At least
I've traced the reason of my problem here. Thank you for your help and
for this great software.


Reply to: