Re: Ports doesnt respect fetch environment settings

From: Gary Jennejohn <gljennjohn_at_googlemail.com>
Date: Mon, 21 Jun 2010 13:07:43 +0200
On Mon, 21 Jun 2010 11:34:12 +0100
Tom Evans <tevans.uk_at_googlemail.com> wrote:

> On Mon, Jun 21, 2010 at 11:10 AM, Erwin Lansing <erwin_at_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=http://proxy:3128/
> >> HTTP_PROXY_AUTH=basic:*:tevans_at_domain.com:password
> >> HTTP_PROXY=http://proxy:3128/
> >> > # fetch http://googlecl.googlecode.com/files/googlecl-0.9.5.tar.gz
> >> googlecl-0.9.5.tar.gz __ __ __ __ __ __ __ __ __ __ __ __ 100% of __ 36 kB __ 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) from the
> > ports infrastructure. __It is documented in /usr/ports/Mk/bsd.port.mk,
> > search for FETCH_BINARY. __Hope 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="-v HTTP_PROXY=$HTTP_PROXY HTTP_PROXY_AUTH=$HTTP_PROXY_AUTH ftp_proxy=$ftp_proxy"
> root_at_strangepork '11:26:21' '/usr/ports/net/googlecl'
> > # make fetch
> ===>  Vulnerability check disabled, database not found
> ===>  License check disabled, port has not defined LICENSE
> => googlecl-0.9.5.tar.gz doesn't seem to exist in /usr/ports/distfiles/.
> => Attempting to fetch from http://googlecl.googlecode.com/files/.
> #env setenv:    HTTP_PROXY=http://proxy:3128/
> #env setenv:    HTTP_PROXY_AUTH=basic:*:tevans_at_domain:pass
> #env setenv:    ftp_proxy=http://proxy:3128/
> #env executing: /usr/bin/fetch
> #env    arg[0]= '/usr/bin/fetch'
> #env    arg[1]= '-ApRr'
> #env    arg[2]= '-S 37867'
> #env    arg[3]= '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
> => Attempting to fetch from ftp://ftp.FreeBSD.org/pub/FreeBSD/ports/distfiles/.
> #env setenv:    HTTP_PROXY=http://proxy:3128/
> #env setenv:    HTTP_PROXY_AUTH=basic:*:tevans_at_domain:pass
> #env setenv:    ftp_proxy=http://proxy:3128/
> #env executing: /usr/bin/fetch
> #env    arg[0]= '/usr/bin/fetch'
> #env    arg[1]= '-ApRr'
> #env    arg[2]= '-S 37867'
> #env    arg[3]=
> '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
> => Couldn't fetch it - please try to retrieve this
> => 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?
> 

Yes.  When you ran fetch by hand you didn't have the -ApRr on the CL.
Could it be that the 'p' flag is causing problems?

Try running fetch by hand again with those flags and see what happens.
If it fails, try removing the 'p' flag.

--
Gary Jennejohn
Received on Mon Jun 21 2010 - 09:07:52 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:04 UTC