summaryrefslogtreecommitdiffstats
path: root/urpm/download.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-03-27 15:07:44 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-03-27 15:07:44 +0000
commit6460607c9bae021928fc0f99efe805d2b0b0fec3 (patch)
tree661b68bc053d1b6bb5ea152d542bd85ffdd7209c /urpm/download.pm
parent144fc3218eef86e6fdf1b915221f402455b40d94 (diff)
downloadurpmi-6460607c9bae021928fc0f99efe805d2b0b0fec3.tar
urpmi-6460607c9bae021928fc0f99efe805d2b0b0fec3.tar.gz
urpmi-6460607c9bae021928fc0f99efe805d2b0b0fec3.tar.bz2
urpmi-6460607c9bae021928fc0f99efe805d2b0b0fec3.tar.xz
urpmi-6460607c9bae021928fc0f99efe805d2b0b0fec3.zip
display an error message when failing to read proxy settings
Diffstat (limited to 'urpm/download.pm')
-rw-r--r--urpm/download.pm10
1 files changed, 9 insertions, 1 deletions
diff --git a/urpm/download.pm b/urpm/download.pm
index 654ee7f3..fb3a8c0b 100644
--- a/urpm/download.pm
+++ b/urpm/download.pm
@@ -89,6 +89,14 @@ sub remove_proxy_media {
defined $proxy_config and delete $proxy_config->{$_[0] || ''};
}
+sub get_proxy_ {
+ my ($urpm, $medium) = @_;
+
+ -e $PROXY_CFG && !-r $PROXY_CFG and $urpm->{error}(N("can not read proxy settings (not enough rights to read %s)", $PROXY_CFG));
+
+ get_proxy($urpm);
+}
+
#- reads and loads the proxy.cfg file ;
#- returns the global proxy settings (without arguments) or the
#- proxy settings for the specified media (with a media name as argument)
@@ -737,7 +745,7 @@ sub sync {
my %all_options = (
dir => "$urpm->{cachedir}/partial",
- proxy => get_proxy($medium),
+ proxy => get_proxy_($urpm, $medium),
$medium ? (media => $medium->{name}) : (),
$urpm->{debug} ? (debug => $urpm->{debug}) : (),
%options,