summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-09-04 08:21:58 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-09-04 08:21:58 +0000
commitbff7eac6fce99f077fb4696c11e6a8b0d1fdceef (patch)
treec094571c361e618d49120932a839e9a624bf5f10 /urpm
parent00fb1374416de81ef2c2a770cbc3eea77cf3a247 (diff)
downloadurpmi-bff7eac6fce99f077fb4696c11e6a8b0d1fdceef.tar
urpmi-bff7eac6fce99f077fb4696c11e6a8b0d1fdceef.tar.gz
urpmi-bff7eac6fce99f077fb4696c11e6a8b0d1fdceef.tar.bz2
urpmi-bff7eac6fce99f077fb4696c11e6a8b0d1fdceef.tar.xz
urpmi-bff7eac6fce99f077fb4696c11e6a8b0d1fdceef.zip
cleanup
Diffstat (limited to 'urpm')
-rw-r--r--urpm/download.pm13
1 files changed, 5 insertions, 8 deletions
diff --git a/urpm/download.pm b/urpm/download.pm
index 1cc8f965..59579fd1 100644
--- a/urpm/download.pm
+++ b/urpm/download.pm
@@ -186,8 +186,7 @@ sub set_proxy {
my @res;
- for ($proxy->{type}) {
- if (/\bwget\b/) {
+ if ($proxy->{type} =~ /\bwget\b/) {
if (defined $p->{http_proxy}) {
$ENV{http_proxy} = $p->{http_proxy} =~ /^http:/
? $p->{http_proxy}
@@ -196,22 +195,20 @@ sub set_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 (/\bcurl\b/) {
+ } 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;
- } elsif (/\baria2\b/) {
+ } 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};
- } else {
+ } else {
die N("Unknown webfetch `%s' !!!\n", $proxy->{type});
- }
- }
+ }
@res;
}