summaryrefslogtreecommitdiffstats
path: root/urpm/download.pm
diff options
context:
space:
mode:
Diffstat (limited to 'urpm/download.pm')
-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;
}