>From 96015c97be92e8bd5d508daed8d14eafd8969fb2 Mon Sep 17 00:00:00 2001 From: Michele La Monaca Date: Sat, 16 Mar 2013 11:35:01 +0100 Subject: [PATCH] Fix setup-proxy to accept http URIs Signed-off-by: Peter Bex --- NEWS | 2 ++ chicken-install.scm | 16 ++++++---------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/NEWS b/NEWS index c21c7cf..c2d16fb 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,8 @@ - Tools - csc: added "-oi"/"-ot" options as alternatives to "-emit-inline-file" and "-emit-type-file", respectively; "-n" has been deprecated. + - chicken-install now also accepts full URI syntax for proxy environment + variables (thanks to Michele La Monaca) - Core libraries - read-line no longer returns trailing CRs in rare cases on TCP ports (#568) diff --git a/chicken-install.scm b/chicken-install.scm index 714cf74..1ba5b97 100644 --- a/chicken-install.scm +++ b/chicken-install.scm @@ -798,16 +798,12 @@ EOF (exit code)) (define (setup-proxy uri) - (if (string? uri) - (begin - (set! *proxy-user-pass* (get-environment-variable "proxy_auth")) - (cond ((irregex-match "(.+)\\:([0-9]+)" uri) => - (lambda (m) - (set! *proxy-host* (irregex-match-substring m 1)) - (set! *proxy-port* (string->number (irregex-match-substring m 2)))) - (else - (set! *proxy-host* uri) - (set! *proxy-port* 80))))))) + (and-let* (((string? uri)) + (m (irregex-match "(http://)?([^:]+):?([0-9]*)" uri)) + (port (irregex-match-substring m 3))) + (set! *proxy-user-pass* (get-environment-variable "proxy_auth")) + (set! *proxy-host* (irregex-match-substring m 2)) + (set! *proxy-port* (or (string->number port) 80)))) (define (info->egg info) (if (member (cdr info) '("" "unknown" "trunk")) -- 1.8.0.1