Changeset 98904


Ignore:
Timestamp:
Oct 20, 2012, 3:58:19 PM (12 years ago)
Author:
jmr@…
Message:

fix svn proxy support to work when a protocol is specified or a port is not

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/base/src/port1.0/portfetch.tcl

    r98574 r98904  
    377377    if {   [string compare -length 7 {http://} ${url}] == 0
    378378        && [info exists env(http_proxy)]} {
    379         set proxy_parts [split $env(http_proxy) :]
    380         set proxy_host [lindex $proxy_parts 0]
    381         set proxy_port [lindex $proxy_parts 1]
    382         return "--config-option servers:global:http-proxy-host=${proxy_host} --config-option servers:global:http-proxy-port=${proxy_port}"
     379        set proxy_str $env(http_proxy)
    383380    } elseif {   [string compare -length 8 {https://} ${url}] == 0
    384381              && [info exists env(HTTPS_PROXY)]} {
    385         set proxy_parts [split $env(HTTPS_PROXY) :]
    386         set proxy_host [lindex $proxy_parts 0]
    387         set proxy_port [lindex $proxy_parts 1]
    388         return "--config-option servers:global:http-proxy-host=${proxy_host} --config-option servers:global:http-proxy-port=${proxy_port}"
     382        set proxy_str $env(HTTPS_PROXY)
    389383    } else {
    390384        return ""
    391385    }
     386    regexp {(.*://)?(\w+)(:(\d+))?} $proxy_str - - proxy_host - proxy_port
     387    set ret "--config-option servers:global:http-proxy-host=${proxy_host}"
     388    if {$proxy_port != ""} {
     389        append ret " --config-option servers:global:http-proxy-port=${proxy_port}"
     390    }
     391    return $ret
    392392}
    393393
Note: See TracChangeset for help on using the changeset viewer.