summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-09-04 08:19:14 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-09-04 08:19:14 +0000
commit5676b0b3a22195ce415945b3198d1d9cede699ef (patch)
tree2de2062e7f5206cebc377ceb02e4ed9fe47ef931
parentc9c318f06b6ffcbc37b7ea4b9ad50296dfb43162 (diff)
downloadurpmi-5676b0b3a22195ce415945b3198d1d9cede699ef.tar
urpmi-5676b0b3a22195ce415945b3198d1d9cede699ef.tar.gz
urpmi-5676b0b3a22195ce415945b3198d1d9cede699ef.tar.bz2
urpmi-5676b0b3a22195ce415945b3198d1d9cede699ef.tar.xz
urpmi-5676b0b3a22195ce415945b3198d1d9cede699ef.zip
cleanup
-rw-r--r--urpm/download.pm42
1 files changed, 20 insertions, 22 deletions
diff --git a/urpm/download.pm b/urpm/download.pm
index 94d5a447..8d71e241 100644
--- a/urpm/download.pm
+++ b/urpm/download.pm
@@ -181,38 +181,36 @@ sub set_proxy_config {
sub set_proxy {
my ($proxy) = @_;
my @res;
- if (defined $proxy->{proxy}{http_proxy} || defined $proxy->{proxy}{ftp_proxy}) {
+ my $p = $proxy->{proxy};
+ if (defined $p->{http_proxy} || defined $p->{ftp_proxy}) {
for ($proxy->{type}) {
/\bwget\b/ and do {
- for ($proxy->{proxy}) {
- if (defined $_->{http_proxy}) {
- $ENV{http_proxy} = $_->{http_proxy} =~ /^http:/
- ? $_->{http_proxy}
- : "http://$_->{http_proxy}";
+ if (defined $p->{http_proxy}) {
+ $ENV{http_proxy} = $p->{http_proxy} =~ /^http:/
+ ? $p->{http_proxy}
+ : "http://$p->{http_proxy}";
}
- $ENV{ftp_proxy} = $_->{ftp_proxy} if defined $_->{ftp_proxy};
- @res = ("--proxy-user=$_->{user}", "--proxy-passwd=$_->{pwd}")
- if defined $_->{user} && defined $_->{pwd};
- }
+ $ENV{ftp_proxy} = $p->{ftp_proxy} if defined $p->{ftp_proxy};
+ @res = ("--proxy-user=$p->{user}", "--proxy-passwd=$p->{pwd}")
+ if defined $p->{user} && defined $p->{pwd};
+
last;
};
/\bcurl\b/ and do {
- for ($proxy->{proxy}) {
- push @res, ('-x', $_->{http_proxy}) if defined $_->{http_proxy};
- push @res, ('-x', $_->{ftp_proxy}) if defined $_->{ftp_proxy};
- push @res, ('-U', "$_->{user}:$_->{pwd}")
- if defined $_->{user} && defined $_->{pwd};
+ push @res, ('-x', $p->{http_proxy}) if defined $p->{http_proxy};
+ push @res, ('-x', $p->{ftp_proxy}) if defined $p->{ftp_proxy};
+ push @res, ('-U', "$p->{user}:$p->{pwd}")
+ if defined $p->{user} && defined $p->{pwd};
push @res, '-H', 'Pragma:' if @res;
- }
+
last;
};
/\baria2\b/ and do {
- for ($proxy->{proxy}) {
- push @res, ('--http-proxy', $_->{http_proxy}) if defined $_->{http_proxy};
- push @res, ('--http-proxy', $_->{ftp_proxy}) if defined $_->{ftp_proxy};
- push @res, ("--http-proxy-user=$_->{user}", "--http-proxy-passwd=$_->{pwd}")
- if defined $_->{user} && defined $_->{pwd};
- }
+ push @res, ('--http-proxy', $p->{http_proxy}) if defined $p->{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};
+
last;
};