diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-11-24 13:19:40 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2004-11-24 13:19:40 +0000 |
commit | d0975a4dc82a25a2f1e2105e9c405fcaf067bdfa (patch) | |
tree | a316b6b26c60105ff8d62140d59eb8b1b79cfe64 | |
parent | 4e3a4d308ebedc84d154d8c55e10f9eeb8d754fc (diff) | |
download | urpmi-d0975a4dc82a25a2f1e2105e9c405fcaf067bdfa.tar urpmi-d0975a4dc82a25a2f1e2105e9c405fcaf067bdfa.tar.gz urpmi-d0975a4dc82a25a2f1e2105e9c405fcaf067bdfa.tar.bz2 urpmi-d0975a4dc82a25a2f1e2105e9c405fcaf067bdfa.tar.xz urpmi-d0975a4dc82a25a2f1e2105e9c405fcaf067bdfa.zip |
When invoking urpmi.addmedia with --proxy, save this proxy setting for
this particular new media. (bug 12483)
-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) |