summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;