diff options
-rw-r--r-- | urpm/download.pm | 11 | ||||
-rwxr-xr-x | urpmi.addmedia | 1 |
2 files changed, 12 insertions, 0 deletions
diff --git a/urpm/download.pm b/urpm/download.pm index 7078fb11..03aa341b 100644 --- a/urpm/download.pm +++ b/urpm/download.pm @@ -88,6 +88,17 @@ sub get_proxy (;$) { }; } +#- copies the settings for proxies from the command line to media named $media +#- and writes the proxy.cfg file (used for new media) +sub copy_cmd_line_proxy { + my ($media) = @_; + return unless $media; + if (defined $proxy_config->{cmd_line}) { + $proxy_config->{$media} = $proxy_config->{cmd_line}; + dump_proxy_config(); + } +} + #- overrides the config file proxy settings with values passed via command-line sub set_cmdline_proxy { my (%h) = @_; diff --git a/urpmi.addmedia b/urpmi.addmedia index 64d393de..41ffc424 100755 --- a/urpmi.addmedia +++ b/urpmi.addmedia @@ -232,6 +232,7 @@ sub main { } $urpm->add_medium($name, $url, $relative_hdlist, virtual => $options{virtual}, update => $options{update}); + urpm::download::copy_cmd_line_proxy($name); $urpm->update_media(%options, callback => \&urpm::download::sync_logger); #- check creation of media (during update has been successfull) |