summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-09-04 08:23:10 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-09-04 08:23:10 +0000
commit51313dd1931e48290004291476d4afde1a6db5f5 (patch)
tree16648c3605c44be42d251cd09a635db2603e25b6 /urpm
parentbff7eac6fce99f077fb4696c11e6a8b0d1fdceef (diff)
downloadurpmi-51313dd1931e48290004291476d4afde1a6db5f5.tar
urpmi-51313dd1931e48290004291476d4afde1a6db5f5.tar.gz
urpmi-51313dd1931e48290004291476d4afde1a6db5f5.tar.bz2
urpmi-51313dd1931e48290004291476d4afde1a6db5f5.tar.xz
urpmi-51313dd1931e48290004291476d4afde1a6db5f5.zip
re-indent
Diffstat (limited to 'urpm')
-rw-r--r--urpm/download.pm37
1 files changed, 17 insertions, 20 deletions
diff --git a/urpm/download.pm b/urpm/download.pm
index 59579fd1..1d254bc4 100644
--- a/urpm/download.pm
+++ b/urpm/download.pm
@@ -185,31 +185,28 @@ sub set_proxy {
defined $p->{http_proxy} || defined $p->{ftp_proxy} or return;
my @res;
-
if ($proxy->{type} =~ /\bwget\b/) {
- if (defined $p->{http_proxy}) {
- $ENV{http_proxy} = $p->{http_proxy} =~ /^http:/
- ? $p->{http_proxy}
- : "http://$p->{http_proxy}";
- }
- $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};
+ if (defined $p->{http_proxy}) {
+ $ENV{http_proxy} = $p->{http_proxy} =~ /^http:/
+ ? $p->{http_proxy} : "http://$p->{http_proxy}";
+ }
+ $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};
} elsif ($proxy->{type} =~ /\bcurl\b/) {
- 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;
+ 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;
} elsif ($proxy->{type} =~ /\baria2\b/) {
- 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};
+ 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};
} else {
- die N("Unknown webfetch `%s' !!!\n", $proxy->{type});
+ die N("Unknown webfetch `%s' !!!\n", $proxy->{type});
}
-
@res;
}