From c9fdb6d4e5b72adba69f81692ee12c2e20366a85 Mon Sep 17 00:00:00 2001 From: Olivier Blin Date: Mon, 26 Jan 2004 22:20:57 +0000 Subject: add downloader option in global config section --- urpmi | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'urpmi') diff --git a/urpmi b/urpmi index c6cb6e87..996b5c84 100755 --- a/urpmi +++ b/urpmi @@ -38,7 +38,6 @@ my $split_level = 20; my $split_length = 1; my $force = 0; my $parallel = ''; -my $sync; my $X = 0; my $WID = 0; my $all = 0; @@ -178,11 +177,8 @@ while (defined($_ = shift @argv)) { /^--allow-nodeps$/ and do { $urpm->{options}{'allow-nodeps'} = 1; next }; /^--allow-force$/ and do { $urpm->{options}{'allow-force'} = 1; next }; /^--parallel$/ and do { push @nextargv, \$parallel; next }; - /^--wget$/ and do { $sync = sub { my $options = shift @_; - if (ref $options) { $options->{prefer} = 'wget' } - else { $options = { dir => $options, prefer => 'wget' } } - urpm::sync_webfetch($options, @_) }; next }; - /^--curl$/ and do { $sync = \&urpm::sync_webfetch; next }; + /^--wget$/ and do { $urpm->{options}{downloader} = 'wget'; next }; + /^--curl$/ and do { $urpm->{options}{downloader} = 'curl'; next }; /^--limit-rate$/ and do { push @nextargv, \$urpm->{options}{'limit-rate'}; next }; /^--proxy$/ and do { my ($proxy, $port) = ($_ = shift @argv) =~ m,^(?:http://)?([^:]+(:\d+)?)/*$, or @@ -316,9 +312,6 @@ if ($log) { open SAVEERR, ">&STDERR"; select SAVEERR; $| = 1; } -#- use specific sync routine. -$sync and $urpm->{sync} = $sync; - #- remove verbose if not asked. unless ($bug) { $urpm->{fatal} = sub { printf SAVEERR "%s\n", $_[1]; exit($_[0]) }; -- cgit v1.2.1