summaryrefslogtreecommitdiffstats
path: root/urpm/download.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-09-04 09:55:54 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-09-04 09:55:54 +0000
commitee0d94725b20dcf88950a2af0527db8e23aad5f5 (patch)
tree6beed0d61bdbfa6043961380261549120179094f /urpm/download.pm
parent97d6e91a63b23d2a8029385932603f0bff8aae0d (diff)
downloadurpmi-ee0d94725b20dcf88950a2af0527db8e23aad5f5.tar
urpmi-ee0d94725b20dcf88950a2af0527db8e23aad5f5.tar.gz
urpmi-ee0d94725b20dcf88950a2af0527db8e23aad5f5.tar.bz2
urpmi-ee0d94725b20dcf88950a2af0527db8e23aad5f5.tar.xz
urpmi-ee0d94725b20dcf88950a2af0527db8e23aad5f5.zip
- fix proxy parameter for aria2 (thanks to alkh)
Diffstat (limited to 'urpm/download.pm')
-rw-r--r--urpm/download.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/urpm/download.pm b/urpm/download.pm
index 108e829c..696e22cc 100644
--- a/urpm/download.pm
+++ b/urpm/download.pm
@@ -48,6 +48,10 @@ sub available_metalink_downloaders() {
grep { -x "/usr/bin/$binaries{$_}" || -x "/bin/$binaries{$_}" } metalink_downloaders();
}
+sub parse_http_proxy {
+ $_[0] =~ m!^(?:http://)?([^:/]+(:\d+)?)/*$!;
+}
+
#- parses proxy.cfg (private)
sub load_proxy_config () {
return if defined $proxy_config;
@@ -200,7 +204,9 @@ sub set_proxy {
if defined $p->{user} && defined $p->{pwd};
push @res, '-H', 'Pragma:' if @res;
} elsif ($proxy->{type} =~ /\baria2\b/) {
- push @res, ('--http-proxy', $p->{http_proxy}) if defined $p->{http_proxy};
+ if (my ($http_proxy) = $p->{http_proxy} && parse_http_proxy($p->{http_proxy})) {
+ push @res, ('--http-proxy', $http_proxy);
+ }
push @res, ('--http-proxy', $p->{ftp_proxy}) if defined $p->{ftp_proxy};
push @res, ("--http-proxy-user=$p->{user}", "--http-proxy-passwd=$p->{pwd}")
if defined $p->{user} && defined $p->{pwd};