summaryrefslogtreecommitdiffstats
path: root/urpm/download.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-03-27 15:13:15 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-03-27 15:13:15 +0000
commit6c9ab48a926d2ed135a891a3abc48d8d9cd7f4c9 (patch)
tree7285054a4cde005ec8eacdf2ec6fc7c27c6c6373 /urpm/download.pm
parent6460607c9bae021928fc0f99efe805d2b0b0fec3 (diff)
downloadurpmi-6c9ab48a926d2ed135a891a3abc48d8d9cd7f4c9.tar
urpmi-6c9ab48a926d2ed135a891a3abc48d8d9cd7f4c9.tar.gz
urpmi-6c9ab48a926d2ed135a891a3abc48d8d9cd7f4c9.tar.bz2
urpmi-6c9ab48a926d2ed135a891a3abc48d8d9cd7f4c9.tar.xz
urpmi-6c9ab48a926d2ed135a891a3abc48d8d9cd7f4c9.zip
simple cleanup
(would need some more)
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