From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 10:34:13 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA159106566B for ; Mon, 21 Jun 2010 10:34:13 +0000 (UTC) (envelope-from tevans.uk@googlemail.com) Received: from mail-fx0-f54.google.com (mail-fx0-f54.google.com [209.85.161.54]) by mx1.freebsd.org (Postfix) with ESMTP id 379F78FC1B for ; Mon, 21 Jun 2010 10:34:12 +0000 (UTC) Received: by fxm7 with SMTP id 7so2131742fxm.13 for ; Mon, 21 Jun 2010 03:34:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=lnkoGvgtLv6przrMQ9UzdTfkXgw11FBclFnNmszZ7Jc=; b=P7sObLkS80jIerWMxx8LSvc5TEdvfngBNH+1SXW4pKVuYluAqS0g/sh5459sIpvQ+J b6fn0Q42TvoSgR6g1TPyPSWiCX04tGo1oavo9Bc1qRI9NAIQIQfEacq72AJT6CY0xMFn Sl3GVGOfxu+HZI+7vvDyHVDzYau1m5xpABrdg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=Im2Y/oGQmXWw4EIqw4jmacxr7d+SiZLxQ6Kc3uIl8QJSRuk5Ska3/2vbY8bzHu7nnq uukEQ9NE0kcqhonI4fwxOiupl9uX7oEKZHn7VaYVJi+5IJhyigTEppLziRJHNz1hJNr5 8ZqHFWdNaFzLGQ/UDpnz6y1C0y8npB/HDQvZo= MIME-Version: 1.0 Received: by 10.239.132.145 with SMTP id 17mr288014hbr.177.1277116452187; Mon, 21 Jun 2010 03:34:12 -0700 (PDT) Received: by 10.239.185.1 with HTTP; Mon, 21 Jun 2010 03:34:12 -0700 (PDT) In-Reply-To: <20100621101046.GA76036@droso.net> References: <20100621101046.GA76036@droso.net> Date: Mon, 21 Jun 2010 11:34:12 +0100 Message-ID: From: Tom Evans To: freebsd-current Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: Ports doesnt respect fetch environment settings X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jun 2010 10:34:13 -0000 On Mon, Jun 21, 2010 at 11:10 AM, Erwin Lansing 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