summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-09-04 08:20:15 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-09-04 08:20:15 +0000
commitda8524bd04312e12936d4b9e15bdd0943cbf81b8 (patch)
tree4d05ba553da6b6a8e01a563cf8ab781e5c7615f1
parent5676b0b3a22195ce415945b3198d1d9cede699ef (diff)
downloadurpmi-da8524bd04312e12936d4b9e15bdd0943cbf81b8.tar
urpmi-da8524bd04312e12936d4b9e15bdd0943cbf81b8.tar.gz
urpmi-da8524bd04312e12936d4b9e15bdd0943cbf81b8.tar.bz2
urpmi-da8524bd04312e12936d4b9e15bdd0943cbf81b8.tar.xz
urpmi-da8524bd04312e12936d4b9e15bdd0943cbf81b8.zip
cleanup
-rw-r--r--urpm/download.pm19
1 files changed, 6 insertions, 13 deletions
diff --git a/urpm/download.pm b/urpm/download.pm
index 8d71e241..1ce3960e 100644
--- a/urpm/download.pm
+++ b/urpm/download.pm
@@ -184,7 +184,7 @@ sub set_proxy {
my $p = $proxy->{proxy};
if (defined $p->{http_proxy} || defined $p->{ftp_proxy}) {
for ($proxy->{type}) {
- /\bwget\b/ and do {
+ if (/\bwget\b/) {
if (defined $p->{http_proxy}) {
$ENV{http_proxy} = $p->{http_proxy} =~ /^http:/
? $p->{http_proxy}
@@ -194,27 +194,20 @@ sub set_proxy {
@res = ("--proxy-user=$p->{user}", "--proxy-passwd=$p->{pwd}")
if defined $p->{user} && defined $p->{pwd};
- last;
- };
- /\bcurl\b/ and do {
+ } elsif (/\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;
-
- last;
- };
- /\baria2\b/ and do {
+ } elsif (/\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};
-
- last;
- };
-
- die N("Unknown webfetch `%s' !!!\n", $proxy->{type});
+ } else {
+ die N("Unknown webfetch `%s' !!!\n", $proxy->{type});
+ }
}
}
return @res;