From 8e1922a4447fd41b5cbd0fc1d0c0596b8808197e Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Thu, 21 Sep 2006 15:47:53 +0000 Subject: Add Prozilla support --- urpm.pm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'urpm.pm') diff --git a/urpm.pm b/urpm.pm index 8ca9994e..ef0a471f 100644 --- a/urpm.pm +++ b/urpm.pm @@ -72,12 +72,15 @@ sub sync_webfetch { $urpm->{fatal}(10, $@) if $@; delete @files{qw(removable file)}; } - for my $cpt (qw(wget-options curl-options rsync-options)) { + for my $cpt (qw(wget-options curl-options rsync-options prozilla-options)) { $options->{$cpt} = $urpm->{options}{$cpt} if defined $urpm->{options}{$cpt}; } if ($files{ftp} || $files{http} || $files{https}) { - my @webfetch = qw(curl wget); - my @available_webfetch = grep { -x "/usr/bin/$_" || -x "/bin/$_" } @webfetch; + my @webfetch = qw(curl wget prozilla); + my %webfetch_executables = (curl => 'curl', wget => 'wget', prozilla => 'proz'); + my @available_webfetch = grep { + -x "/usr/bin/$webfetch_executables{$_}" || -x "/bin/$webfetch_executables{$_}" + } @webfetch; #- use user default downloader if provided and available my $option_downloader = $urpm->{options}{downloader}; #- cmd-line switch if (!$option_downloader && $options->{media}) { #- per-media config @@ -98,6 +101,8 @@ sub sync_webfetch { sync_curl($options, @{$files{ftp} || []}, @{$files{http} || []}, @{$files{https} || []}); } elsif ($preferred eq 'wget') { sync_wget($options, @{$files{ftp} || []}, @{$files{http} || []}, @{$files{https} || []}); + } elsif ($preferred eq 'prozilla') { + sync_prozilla($options, @{$files{ftp} || []}, @{$files{http} || []}, @{$files{https} || []}); } else { die N("no webfetch found, supported webfetch are: %s\n", join(", ", @webfetch)); } @@ -179,6 +184,7 @@ sub read_config { curl-options rsync-options wget-options + prozilla-options )) { if (defined $config->{''}{$opt} && !exists $urpm->{options}{$opt}) { $urpm->{options}{$opt} = $config->{''}{$opt}; -- cgit v1.2.1