From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Re: [PATCH 1/2] svn-download: Respect current-http-proxy when downloading. Date: Thu, 03 Mar 2016 17:39:21 +0100 Message-ID: <87povbcy86.fsf@gnu.org> References: <56c321a5.8445620a.d0d47.3c13@mx.google.com> <871t7wwzrx.fsf@gnu.org> <20160303043205.GA28472@novena-choice-citizen.lan> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44657) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abWHg-0004qv-PN for guix-devel@gnu.org; Thu, 03 Mar 2016 11:39:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1abWHb-0002U1-Qo for guix-devel@gnu.org; Thu, 03 Mar 2016 11:39:28 -0500 In-Reply-To: <20160303043205.GA28472@novena-choice-citizen.lan> (Jookia's message of "Thu, 3 Mar 2016 15:32:05 +1100") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Jookia <166291@gmail.com> Cc: guix-devel@gnu.org Jookia <166291@gmail.com> skribis: > On Sun, Feb 28, 2016 at 05:44:18PM +0100, Ludovic Court=C3=A8s wrote: >> > + (define proxy-config >> > + (if (current-http-proxy) >> > + (and-let* ((proxy-uri (string->uri (current-http-proxy))) >> > + (proxy-host (uri-host proxy-uri)) >> > + (proxy-port (number->string (uri-port proxy-uri))) >> > + (config-host "servers:global:http-proxy-host=3D") >> > + (config-port "servers:global:http-proxy-port=3D")) >> > + `("--config-option" ,(string-append config-host proxy-host) >> > + "--config-option" ,(string-append config-port proxy-port))) >> > + '())) >>=20 >> I would suggest using an explicit (getenv "http_proxy") instead of >> (current-http-proxy) since the latter is specific to the (web =E2=80=A6) >> modules, which are not involved here. > > Sorry for the reply, now that I have an RFC for the coreboot patches I've= looked > back at this. The URI module is also in the web module, and I'm not sure = how I > feel about rewriting a URI parser to get the host and port out of http_pr= oxy. Of course you should keep using =E2=80=98string->uri=E2=80=99, no problem w= ith that. I=E2=80=99m just saying that the code should explicitly check for the =E2=80=98http_proxy=E2=80=99 environment variable instead of using the =E2=80=98current-http-proxy=E2=80=99 SRFI-9 parameter. WDYT? Ludo=E2=80=99.