From owner-freebsd-current@FreeBSD.ORG Mon Jun 21 11:07:52 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 B944B106567C for ; Mon, 21 Jun 2010 11:07:52 +0000 (UTC) (envelope-from gljennjohn@googlemail.com) Received: from mail-bw0-f54.google.com (mail-bw0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 3AEA68FC2E for ; Mon, 21 Jun 2010 11:07:51 +0000 (UTC) Received: by bwz8 with SMTP id 8so1510297bwz.13 for ; Mon, 21 Jun 2010 04:07:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:in-reply-to:references:reply-to:x-mailer:mime-version :content-type:content-transfer-encoding; bh=Nzfq86K2YW9dZcO6DnEF9K+f18EygHiqZNnW30UTZpQ=; b=IVGHvk5jp4incg+Dek7PvDoaH5Qkbzhr3qXjDC3kfnVS/IcMY7NnttPar9b0ptzouK NHybNp+1CkiM/lA8dP9/jBHzudLkcXamNmAGbFDKiWNkC6teVwj1ykCgtZy3m21FDnSl IrCyMZ52jXp09383QIXTgCbCP1p2Nsd2aawQY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=date:from:to:cc:subject:message-id:in-reply-to:references:reply-to :x-mailer:mime-version:content-type:content-transfer-encoding; b=dxTKdyMfmg358pKQhlb0/GudnzHV4a+pVewg/7wdRN9JSb26UKnz0Zgyx9uhax1HVd ZVpoVn50gO1ag0iFxZk9PBT9t/XOHEIIB5mxJcv2AQwWXlGa4OwNiuqm0wB7UhPWO496 AaHR0kEoltyK9O3wO8oIMIkFOJ5O58wo9Msfw= Received: by 10.204.83.197 with SMTP id g5mr1295279bkl.114.1277118466433; Mon, 21 Jun 2010 04:07:46 -0700 (PDT) Received: from ernst.jennejohn.org (p578E1A33.dip.t-dialin.net [87.142.26.51]) by mx.google.com with ESMTPS id w11sm6941175bka.44.2010.06.21.04.07.44 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 21 Jun 2010 04:07:45 -0700 (PDT) Date: Mon, 21 Jun 2010 13:07:43 +0200 From: Gary Jennejohn To: Tom Evans Message-ID: <20100621130743.4df77343@ernst.jennejohn.org> In-Reply-To: References: <20100621101046.GA76036@droso.net> X-Mailer: Claws Mail 3.7.5 (GTK+ 2.18.7; amd64-portbld-freebsd9.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: freebsd-current Subject: Re: Ports doesnt respect fetch environment settings X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: gljennjohn@googlemail.com 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 11:07:52 -0000 On Mon, 21 Jun 2010 11:34:12 +0100 Tom Evans wrote: > 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=http://proxy:3128/ > >> HTTP_PROXY_AUTH=basic:*:tevans@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@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@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@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