summaryrefslogtreecommitdiffstats
path: root/urpm/download.pm
diff options
context:
space:
mode:
Diffstat (limited to 'urpm/download.pm')
-rw-r--r--urpm/download.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/urpm/download.pm b/urpm/download.pm
index fb3a8c0b..801fc980 100644
--- a/urpm/download.pm
+++ b/urpm/download.pm
@@ -63,7 +63,8 @@ sub load_proxy_config () {
#- writes proxy.cfg
sub dump_proxy_config () {
- return 0 unless defined $proxy_config; #- hasn't been read yet
+ $proxy_config or return 0; #- hasn't been read yet
+
open my $f, '>', $PROXY_CFG or return 0;
foreach ('', sort grep { !/^(|cmd_line)$/ } keys %$proxy_config) {
my $m = $_ eq '' ? '' : "$_:";
@@ -74,10 +75,9 @@ sub dump_proxy_config () {
}
if ($p->{ask}) {
print $f "${m}proxy_user_ask\n";
- next;
+ } elsif (defined $p->{user} && $p->{user} ne '') {
+ print $f "${m}proxy_user=$p->{user}:$p->{pwd}\n";
}
- defined $p->{user} && $p->{user} ne ''
- and print $f "${m}proxy_user=$p->{user}:$p->{pwd}\n";
}
close $f;
chmod 0600, $PROXY_CFG; #- may contain passwords