summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2006-03-20 08:46:39 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2006-03-20 08:46:39 +0000
commitbd718a9f0982621e5aa6a1af395ce89872f67e3d (patch)
tree98148db269d0ba1f18639b6f2041bdc6ddffaae3
parentd51c3a6c4b0482778f4dbdd5c968995474aa9e64 (diff)
downloadurpmi-bd718a9f0982621e5aa6a1af395ce89872f67e3d.tar
urpmi-bd718a9f0982621e5aa6a1af395ce89872f67e3d.tar.gz
urpmi-bd718a9f0982621e5aa6a1af395ce89872f67e3d.tar.bz2
urpmi-bd718a9f0982621e5aa6a1af395ce89872f67e3d.tar.xz
urpmi-bd718a9f0982621e5aa6a1af395ce89872f67e3d.zip
Patch by Michael Scherer (with tweaks) to warn the user when urpmi is using
another web-downloader than the one specified in the configuration (because it's not available) (bug #21661)
-rw-r--r--urpm.pm11
1 files changed, 6 insertions, 5 deletions
diff --git a/urpm.pm b/urpm.pm
index 69740581..eb585e49 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -84,8 +84,7 @@ sub sync_webfetch {
}
if ($files{ftp} || $files{http} || $files{https}) {
my @webfetch = qw(curl wget);
- my @available_webfetch = grep { -x "/usr/bin/$_" } @webfetch;
- my $preferred;
+ my @available_webfetch = grep { -x "/usr/bin/$_" || -x "/bin/$_" } @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
@@ -95,11 +94,13 @@ sub sync_webfetch {
#- global config
!$option_downloader && exists $urpm->{global_config}{downloader}
and $option_downloader = $urpm->{global_config}{downloader};
- if ($option_downloader) {
- ($preferred) = grep { $_ eq $option_downloader } @available_webfetch;
- }
+ my ($preferred) = grep { $_ eq $option_downloader } @available_webfetch;
#- else first downloader of @webfetch is the default one
$preferred ||= $available_webfetch[0];
+ if ($option_downloader ne $preferred && $option_downloader && !our $webfetch_not_available) {
+ $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') {