Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 21 Jun 2010 11:34:12 +0100
From:      Tom Evans <tevans.uk@googlemail.com>
To:        freebsd-current <freebsd-current@freebsd.org>
Subject:   Re: Ports doesnt respect fetch environment settings
Message-ID:  <AANLkTilhgzVDFX9MGQTS_DzJt_5QtlaNF--nQss-5mzj@mail.gmail.com>
In-Reply-To: <20100621101046.GA76036@droso.net>
References:  <AANLkTinn5bPXDf-tRIlpGCp3iFgtYi20mzRSbqkBcj6b@mail.gmail.com> <20100621101046.GA76036@droso.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Jun 21, 2010 at 11:10 AM, Erwin Lansing <erwin@freebsd.org> wrote:
> On Mon, Jun 21, 2010 at 11:04:16AM +0100, Tom Evans wrote:
>> My company recently enabled proxy authentication for outgoing
>> connections, and this has stopped ports from working.
>>
>> >From fetch(5), I understand that I can place my proxy authentication
>> in plain text in the environment*, and this will allow fetch to work
>> correctly, and this does work:
>>
>> > # env | grep -i proxy
>> ftp_proxy=3Dhttp://proxy:3128/
>> HTTP_PROXY_AUTH=3Dbasic:*:tevans@domain.com:password
>> HTTP_PROXY=3Dhttp://proxy:3128/
>> > # fetch http://googlecl.googlecode.com/files/googlecl-0.9.5.tar.gz
>> googlecl-0.9.5.tar.gz =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 100% of =C2=A0 36 kB =C2=A0 77 MBps
>>
>> However, the ports makefiles seem to do something funky to my
>> environment which hides these environment variables, and so the ports
>> infrastructure stops working:
>>
> You should use FETCH_ENV or FETCH_ARGS to pass information to fetch(1) fr=
om the
> ports infrastructure. =C2=A0It is documented in /usr/ports/Mk/bsd.port.mk=
,
> search for FETCH_BINARY. =C2=A0Hope that helps.
>
> -erwin
>
Er, ok that makes slight sense. In /usr/ports/Mk/bsd.port.mk it says:

# FETCH_ENV     - Environment to pass to ${FETCH_CMD}.
#                 Default: none

So how is it picking up that it needs to go thru a proxy at all, given
that this is also only specified in the environment?

Also, am I supposed to literally repeat my same environment variables
in FETCH_ENV? Meaning I have to place my password in plain text again
in my environment? This is horrific...

Also, even after doing that, it still doesn't look at the environment
variables. I prepended "-v" to FETCH_ENV to show that it is setting
the right environment variables, but fetch in ports is still not
looking at them:

> # export FETCH_ENV=3D"-v HTTP_PROXY=3D$HTTP_PROXY HTTP_PROXY_AUTH=3D$HTTP=
_PROXY_AUTH ftp_proxy=3D$ftp_proxy"
root@strangepork '11:26:21' '/usr/ports/net/googlecl'
> # make fetch
=3D=3D=3D>  Vulnerability check disabled, database not found
=3D=3D=3D>  License check disabled, port has not defined LICENSE
=3D> googlecl-0.9.5.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
=3D> Attempting to fetch from http://googlecl.googlecode.com/files/.
#env setenv:    HTTP_PROXY=3Dhttp://proxy:3128/
#env setenv:    HTTP_PROXY_AUTH=3Dbasic:*:tevans@domain:pass
#env setenv:    ftp_proxy=3Dhttp://proxy:3128/
#env executing: /usr/bin/fetch
#env    arg[0]=3D '/usr/bin/fetch'
#env    arg[1]=3D '-ApRr'
#env    arg[2]=3D '-S 37867'
#env    arg[3]=3D 'http://googlecl.googlecode.com/files/googlecl-0.9.5.tar.=
gz'
fetch: http://googlecl.googlecode.com/files/googlecl-0.9.5.tar.gz:
Proxy Authentication Required
=3D> Attempting to fetch from ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distf=
iles/.
#env setenv:    HTTP_PROXY=3Dhttp://proxy:3128/
#env setenv:    HTTP_PROXY_AUTH=3Dbasic:*:tevans@domain:pass
#env setenv:    ftp_proxy=3Dhttp://proxy:3128/
#env executing: /usr/bin/fetch
#env    arg[0]=3D '/usr/bin/fetch'
#env    arg[1]=3D '-ApRr'
#env    arg[2]=3D '-S 37867'
#env    arg[3]=3D
'ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/googlecl-0.9.5.tar.gz'
fetch: ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/googlecl-0.9.5.tar=
.gz:
Not Found
=3D> Couldn't fetch it - please try to retrieve this
=3D> port manually into /usr/ports/distfiles/ and try again.
*** Error code 1

*.freebsd.org is whitelisted through the proxies, which is why the
second fetch gets a 404 and not a 407

Any thoughts?

Cheers



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTilhgzVDFX9MGQTS_DzJt_5QtlaNF--nQss-5mzj>