summaryrefslogtreecommitdiffstats
path: root/perl-install
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install')
-rw-r--r--perl-install/any.pm16
1 files changed, 16 insertions, 0 deletions
diff --git a/perl-install/any.pm b/perl-install/any.pm
index 933976302..011fb4f73 100644
--- a/perl-install/any.pm
+++ b/perl-install/any.pm
@@ -1197,6 +1197,22 @@ sub urpmi_add_all_media {
$val;
}
+sub urpmi_set_downloader {
+ my ($in, $urpm, $downloader) = @_;
+
+ if ($urpm->{global_config}{downloader} ne $downloader) {
+ my $binary = $downloader eq 'aria2' ? 'aria2c' : $downloader;
+ if ($in->do_pkgs->ensure_binary_is_installed($downloader, $binary, 1)) {
+ log::l("Setting urpmi downloader to '$downloader'");
+ $urpm->{global_config}{downloader} = $downloader;
+ urpm::media::write_config($urpm);
+ } else {
+ return;
+ }
+ }
+ 1;
+}
+
sub format_wm {
my ($wm) = @_;
return {