summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-09-03 12:44:46 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-09-03 12:44:46 +0000
commitdf7a78fa5d2b71afe1d7665671f11979d035b466 (patch)
treea3e92d9a7d5a72b59fda4938259a8a5b108a503b
parent617768a914054de8b75f9610087de2cb07b9eb63 (diff)
downloadurpmi-df7a78fa5d2b71afe1d7665671f11979d035b466.tar
urpmi-df7a78fa5d2b71afe1d7665671f11979d035b466.tar.gz
urpmi-df7a78fa5d2b71afe1d7665671f11979d035b466.tar.bz2
urpmi-df7a78fa5d2b71afe1d7665671f11979d035b466.tar.xz
urpmi-df7a78fa5d2b71afe1d7665671f11979d035b466.zip
create urpm::download::sync_rel() and use it
-rw-r--r--urpm/download.pm7
-rw-r--r--urpm/media.pm6
2 files changed, 10 insertions, 3 deletions
diff --git a/urpm/download.pm b/urpm/download.pm
index 244cc45e..244d6d72 100644
--- a/urpm/download.pm
+++ b/urpm/download.pm
@@ -762,6 +762,13 @@ sub url_obscuring_password {
}
}
+sub sync_rel {
+ my ($urpm, $medium, $rel_files, %options) = @_;
+
+ my @files = map { reduce_pathname("$medium->{url}/$_") } @$rel_files;
+ sync($urpm, $medium, \@files, %options);
+}
+
#- $medium can be undef
#- known options: quiet, resume, callback
sub sync {
diff --git a/urpm/media.pm b/urpm/media.pm
index 3e11710c..3cb58a5d 100644
--- a/urpm/media.pm
+++ b/urpm/media.pm
@@ -1014,7 +1014,7 @@ sub may_reconfig_urpmi {
$f = reduce_pathname("$dir/reconfig.urpmi");
} else {
unlink($f = "$urpm->{cachedir}/partial/reconfig.urpmi");
- urpm::download::sync($urpm, $medium, [ reduce_pathname("$medium->{url}/reconfig.urpmi") ], quiet => 1);
+ urpm::download::sync_rel($urpm, $medium, 'reconfig.urpmi') ], quiet => 1);
}
if (-s $f) {
reconfig_urpmi($urpm, $f, $medium);
@@ -1231,9 +1231,9 @@ sub get_descriptions_remote {
if (-e statedir_descriptions($urpm, $medium)) {
urpm::sys::move_or_die($urpm, statedir_descriptions($urpm, $medium), "$urpm->{cachedir}/partial/descriptions");
}
- urpm::download::sync($urpm, $medium, [ reduce_pathname("$medium->{url}/media_info/descriptions") ], quiet => 1)
+ urpm::download::sync_rel($urpm, $medium, [ 'media_info/descriptions' ], quiet => 1)
or #- try older location
- urpm::download::sync($urpm, $medium, [ reduce_pathname("$medium->{url}/../descriptions") ], quiet => 1);
+ urpm::download::sync_rel($urpm, $medium, [ '../descriptions' ], quiet => 1);
if (-e "$urpm->{cachedir}/partial/descriptions") {
urpm::sys::move_or_die($urpm, "$urpm->{cachedir}/partial/descriptions", statedir_descriptions($urpm, $medium));