summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2011-12-05 00:02:18 +0000
committerThierry Vignaud <tv@mageia.org>2011-12-05 00:02:18 +0000
commit7d9774ed4242385bbd7f9631c60c838ce6f21cb1 (patch)
tree776a56df5fb94a8672cb1cfed0451d980f30b00e
parentd1213191f9beee0c14835aee80c8d3f669589250 (diff)
downloadurpmi-7d9774ed4242385bbd7f9631c60c838ce6f21cb1.tar
urpmi-7d9774ed4242385bbd7f9631c60c838ce6f21cb1.tar.gz
urpmi-7d9774ed4242385bbd7f9631c60c838ce6f21cb1.tar.bz2
urpmi-7d9774ed4242385bbd7f9631c60c838ce6f21cb1.tar.xz
urpmi-7d9774ed4242385bbd7f9631c60c838ce6f21cb1.zip
(_pick_one_) do not pick rsync medium if rsync is not installed (mga#3557)
-rw-r--r--NEWS2
-rw-r--r--urpm/mirrors.pm8
2 files changed, 9 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index a269fdaa..42e422e7 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,5 @@
+- urpmi.addmedia:
+ o do not pick rsync medium if rsync is not installed (mga#3557)
- urpmi.update:
o document that -a only works on enabled media (mga#3190)
diff --git a/urpm/mirrors.pm b/urpm/mirrors.pm
index 3c9ebb25..221062b1 100644
--- a/urpm/mirrors.pm
+++ b/urpm/mirrors.pm
@@ -113,7 +113,13 @@ sub _pick_one_ {
$cache->{product_id_mtime} = _product_id_mtime();
}
- $cache->{chosen} = $cache->{list}[0]{url} or return;
+ if (-x '/usr/bin/rsync') {
+ $cache->{chosen} = $cache->{list}[0]{url};
+ } else {
+ my $m = find { $_->{url} !~ m!^rsync://! } @{$cache->{list}};
+ $cache->{chosen} = $m->{url};
+ }
+ $cache->{chosen} or return;
_save_cache($urpm);
}
$cache;