summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-09-03 14:52:38 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-09-03 14:52:38 +0000
commita0b4576d2bed2e7aeb06f972c7b1faf1d0a4c577 (patch)
tree7175ecea33893d4deaa0b59ae6f5aacfd5a273d3 /urpm
parentbb99abdb7eb969270226e945ad74b4b479090a2c (diff)
downloadurpmi-a0b4576d2bed2e7aeb06f972c7b1faf1d0a4c577.tar
urpmi-a0b4576d2bed2e7aeb06f972c7b1faf1d0a4c577.tar.gz
urpmi-a0b4576d2bed2e7aeb06f972c7b1faf1d0a4c577.tar.bz2
urpmi-a0b4576d2bed2e7aeb06f972c7b1faf1d0a4c577.tar.xz
urpmi-a0b4576d2bed2e7aeb06f972c7b1faf1d0a4c577.zip
move %all_options computation in _all_options()
Diffstat (limited to 'urpm')
-rw-r--r--urpm/download.pm30
1 files changed, 18 insertions, 12 deletions
diff --git a/urpm/download.pm b/urpm/download.pm
index c36cf62a..2499ace8 100644
--- a/urpm/download.pm
+++ b/urpm/download.pm
@@ -762,6 +762,23 @@ sub url_obscuring_password {
}
}
+#- $medium can be undef
+sub _all_options {
+ my ($urpm, $medium, $options) = @_;
+
+ my %all_options = (
+ dir => "$urpm->{cachedir}/partial",
+ proxy => get_proxy_($urpm, $medium),
+ metalink => $medium->{mirrorlist},
+ $urpm->{debug} ? (debug => $urpm->{debug}) : (),
+ %$options,
+ );
+ foreach my $cpt (qw(compress limit-rate retry wget-options curl-options rsync-options prozilla-options aria2-options metalink)) {
+ $all_options{$cpt} = $urpm->{options}{$cpt} if defined $urpm->{options}{$cpt};
+ }
+ \%all_options;
+}
+
sub sync_rel {
my ($urpm, $medium, $rel_files, %options) = @_;
@@ -780,22 +797,11 @@ sub sync_url {
sub sync {
my ($urpm, $medium, $files, %options) = @_;
- my %all_options = (
- dir => "$urpm->{cachedir}/partial",
- proxy => get_proxy_($urpm, $medium),
- metalink => $medium->{mirrorlist},
- $urpm->{debug} ? (debug => $urpm->{debug}) : (),
- %options,
- );
- foreach my $cpt (qw(compress limit-rate retry wget-options curl-options rsync-options prozilla-options aria2-options metalink)) {
- $all_options{$cpt} = $urpm->{options}{$cpt} if defined $urpm->{options}{$cpt};
- }
-
my $files_text = join(' ', map { url_obscuring_password($_) } @$files);
$urpm->{debug} and $urpm->{debug}(N("retrieving %s", $files_text));
eval {
- _sync_webfetch_raw($urpm, $medium, $files, \%all_options);
+ _sync_webfetch_raw($urpm, $medium, $files, _all_options($urpm, $medium, \%options));
$urpm->{log}(N("retrieved %s", $files_text));
1;
};