summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
authorMandrake <mandrake@mandriva.com>2006-10-26 20:23:19 +0000
committerMandrake <mandrake@mandriva.com>2006-10-26 20:23:19 +0000
commitf7248aabb16ba627fe3f2b3362e6c452956dbb6e (patch)
tree1970ad313bc7f049625d57e70b82b0cbfa970449 /urpm.pm
parent147659d651d3d1c2e8599d002933eb23667f43b9 (diff)
downloadurpmi-f7248aabb16ba627fe3f2b3362e6c452956dbb6e.tar
urpmi-f7248aabb16ba627fe3f2b3362e6c452956dbb6e.tar.gz
urpmi-f7248aabb16ba627fe3f2b3362e6c452956dbb6e.tar.bz2
urpmi-f7248aabb16ba627fe3f2b3362e6c452956dbb6e.tar.xz
urpmi-f7248aabb16ba627fe3f2b3362e6c452956dbb6e.zip
Created directory for version 0.9.6.
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm13
1 files changed, 4 insertions, 9 deletions
diff --git a/urpm.pm b/urpm.pm
index 5073675e..3e5c2f7a 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -94,6 +94,7 @@ sub _sync_webfetch_raw {
if ($files{ftp} || $files{http} || $files{https}) {
my @webfetch = qw(curl wget prozilla);
my %webfetch_executables = (curl => 'curl', wget => 'wget', prozilla => 'proz');
+ my %webfetch_funcs = (curl => \&sync_curl, wget => \&sync_wget, prozilla => \&sync_prozilla);
my @available_webfetch = grep {
-x "/usr/bin/$webfetch_executables{$_}" || -x "/bin/$webfetch_executables{$_}";
} @webfetch;
@@ -113,15 +114,9 @@ sub _sync_webfetch_raw {
$urpm->{log}(N("%s is not available, falling back on %s", $option_downloader, $preferred));
$webfetch_not_available = 1;
}
- if ($preferred eq 'curl') {
- 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));
- }
+ my $sync = $webfetch_funcs{$preferred} or die N("no webfetch found, supported webfetch are: %s\n", join(", ", @webfetch));
+ $sync->($options, @{$files{ftp} || []}, @{$files{http} || []}, @{$files{https} || []});
+
delete @files{qw(ftp http https)};
}
if ($files{rsync}) {