unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Jookia <166291@gmail.com>
To: "Ludovic Courtès" <ludo@gnu.org>
Cc: guix-devel@gnu.org
Subject: Re: [PATCH 1/2] svn-download: Respect current-http-proxy when downloading.
Date: Mon, 29 Feb 2016 08:45:56 +1100	[thread overview]
Message-ID: <20160228214556.GA29738@novena-choice-citizen.lan> (raw)
In-Reply-To: <871t7wwzrx.fsf@gnu.org>

On Sun, Feb 28, 2016 at 05:44:18PM +0100, Ludovic Courtès wrote:
> Sorry for the delay, and thanks for the useful patch!

No problem. :)

> I gather ‘svn’ doesn’t honor ‘http_proxy’ in the first place, right?
> That would have simplified things.

It really would, but for some reason that's not a feature. Well, it was for one
or two releases but that was unintentional and fixed.

> Also, what about ‘https_proxy’?  (This could be left for a subsequent
> patch, if you prefer.)

I'd have to parse the subversion URL and figure out if its scheme is HTTPS as I
don't think Subverion has a https-proxy-* set of variables.

> > +  (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=")
> > +                 (config-port "servers:global:http-proxy-port="))
> > +        `("--config-option" ,(string-append config-host proxy-host)
> > +          "--config-option" ,(string-append config-port proxy-port)))
> > +      '()))
> 
> I would suggest using an explicit (getenv "http_proxy") instead of
> (current-http-proxy) since the latter is specific to the (web …)
> modules, which are not involved here.
> 
> Also, I’m not a fan of SRFI-2.  :-)  So I’d write it as:
> 
>   (match (getenv "http_proxy")
>     (#f '())
>     (uri-string
>      (let* ((uri  (string->uri uri-string))
>             (host (uri-host uri))
>             (port (uri-port uri)))
>        (list (string-append
>               "--config-option=servers:global:http-proxy-host="
>               host)
>              (string-append
>               "--config-option=servers:global:http-proxy-port="
>               (number->string port))))))
> 
> Probably with something like:
> 
>   (unless uri
>     (format (current-error-port) "invalid HTTP proxy URI: ~s~%"
>             uri-string)
>     (exit 1))

Interesting!

> Could you send an updated patch?

Sure, I'll do it hopefully this week.

> Thanks!
>
> Ludo’.

Cheers,
Jookia.

  reply	other threads:[~2016-02-28 21:46 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-16 12:37 [PATCH 1/2] svn-download: Respect current-http-proxy when downloading Jookia
2016-02-28 16:44 ` Ludovic Courtès
2016-02-28 21:45   ` Jookia [this message]
2020-03-15 11:22     ` levenson
2020-03-15 12:45       ` Jookia
2020-03-15 18:04       ` Leo Famulari
2016-03-03  4:32   ` Jookia
2016-03-03 16:39     ` Ludovic Courtès
2016-03-03 16:44       ` Jookia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160228214556.GA29738@novena-choice-citizen.lan \
    --to=166291@gmail.com \
    --cc=guix-devel@gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).