summaryrefslogtreecommitdiffstats
path: root/urpm/download.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2006-11-09 13:55:28 +0000
committerPascal Rigaux <pixel@mandriva.com>2006-11-09 13:55:28 +0000
commit9f118da9297cb44b4ce04274129887507dd26510 (patch)
tree1ce49e47ef1e95926bf296a3417cce89d0e2bd30 /urpm/download.pm
parentf0c1d7a629c9026d231ec943548a9a6b3eb0d939 (diff)
downloadurpmi-9f118da9297cb44b4ce04274129887507dd26510.tar
urpmi-9f118da9297cb44b4ce04274129887507dd26510.tar.gz
urpmi-9f118da9297cb44b4ce04274129887507dd26510.tar.bz2
urpmi-9f118da9297cb44b4ce04274129887507dd26510.tar.xz
urpmi-9f118da9297cb44b4ce04274129887507dd26510.zip
factorize introducing proc_mounts() and cat_()
Diffstat (limited to 'urpm/download.pm')
-rw-r--r--urpm/download.pm7
1 files changed, 3 insertions, 4 deletions
diff --git a/urpm/download.pm b/urpm/download.pm
index 1eba2504..1019120d 100644
--- a/urpm/download.pm
+++ b/urpm/download.pm
@@ -5,6 +5,7 @@ package urpm::download;
use strict;
use urpm::msg;
use urpm::cfg;
+use urpm::util;
use Cwd;
(our $VERSION) = q($Revision$) =~ /(\d+)/;
@@ -33,9 +34,8 @@ sub import () {
#- parses proxy.cfg (private)
sub load_proxy_config () {
return if defined $proxy_config;
- open my $f, $PROXY_CFG or $proxy_config = {}, return;
- local $_;
- while (<$f>) {
+ $proxy_config = {};
+ foreach (cat_($PROXY_CFG)) {
chomp; s/#.*$//; s/^\s*//; s/\s*$//;
if (/^(?:(.*):\s*)?(ftp_proxy|http_proxy)\s*=\s*(.*)$/) {
$proxy_config->{$1 || ''}{$2} = $3;
@@ -51,7 +51,6 @@ sub load_proxy_config () {
next;
}
}
- close $f;
}
#- writes proxy.cfg