[98904] trunk/base/src/port1.0/portfetch.tcl

jmr at macports.org jmr at macports.org
Sat Oct 20 08:58:19 PDT 2012


Revision: 98904
          http://trac.macports.org//changeset/98904
Author:   jmr at macports.org
Date:     2012-10-20 08:58:19 -0700 (Sat, 20 Oct 2012)
Log Message:
-----------
fix svn proxy support to work when a protocol is specified or a port is not

Modified Paths:
--------------
    trunk/base/src/port1.0/portfetch.tcl

Modified: trunk/base/src/port1.0/portfetch.tcl
===================================================================
--- trunk/base/src/port1.0/portfetch.tcl	2012-10-20 15:42:38 UTC (rev 98903)
+++ trunk/base/src/port1.0/portfetch.tcl	2012-10-20 15:58:19 UTC (rev 98904)
@@ -376,19 +376,19 @@
 
     if {   [string compare -length 7 {http://} ${url}] == 0
         && [info exists env(http_proxy)]} {
-        set proxy_parts [split $env(http_proxy) :]
-        set proxy_host [lindex $proxy_parts 0]
-        set proxy_port [lindex $proxy_parts 1]
-        return "--config-option servers:global:http-proxy-host=${proxy_host} --config-option servers:global:http-proxy-port=${proxy_port}"
+        set proxy_str $env(http_proxy)
     } elseif {   [string compare -length 8 {https://} ${url}] == 0
               && [info exists env(HTTPS_PROXY)]} {
-        set proxy_parts [split $env(HTTPS_PROXY) :]
-        set proxy_host [lindex $proxy_parts 0]
-        set proxy_port [lindex $proxy_parts 1]
-        return "--config-option servers:global:http-proxy-host=${proxy_host} --config-option servers:global:http-proxy-port=${proxy_port}"
+        set proxy_str $env(HTTPS_PROXY)
     } else {
         return ""
     }
+    regexp {(.*://)?(\w+)(:(\d+))?} $proxy_str - - proxy_host - proxy_port
+    set ret "--config-option servers:global:http-proxy-host=${proxy_host}"
+    if {$proxy_port != ""} {
+        append ret " --config-option servers:global:http-proxy-port=${proxy_port}"
+    }
+    return $ret
 }
 
 # Perform an svn fetch
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20121020/174e4d85/attachment.html>


More information about the macports-changes mailing list