summaryrefslogtreecommitdiffstats
path: root/urpm/download.pm
diff options
context:
space:
mode:
Diffstat (limited to 'urpm/download.pm')
-rw-r--r--urpm/download.pm23
1 files changed, 19 insertions, 4 deletions
diff --git a/urpm/download.pm b/urpm/download.pm
index 4308f9f6..8f46df6d 100644
--- a/urpm/download.pm
+++ b/urpm/download.pm
@@ -47,12 +47,27 @@ sub load_proxy_config () {
sub get_proxy (;$) {
my ($o_media) = @_; $o_media ||= '';
load_proxy_config();
- return $proxy_config->{$o_media} || {
- http_proxy => undef ,
- ftp_proxy => undef ,
+ return $proxy_config->{cmd_line}
+ || $proxy_config->{$o_media}
+ || $proxy_config->{''}
+ || {
+ http_proxy => undef,
+ ftp_proxy => undef,
+ user => undef,
+ pwd => undef,
+ };
+}
+
+#- overrides the config file proxy settings with values passed via command-line
+sub set_cmdline_proxy {
+ my (%h) = @_;
+ $proxy_config->{cmd_line} ||= {
+ http_proxy => undef,
+ ftp_proxy => undef,
user => undef,
- pwd => undef
+ pwd => undef,
};
+ $proxy_config->{cmd_line}{$_} = $h{$_} for keys %h;
}
#- set up the environment for proxy usage for the appropriate tool.