diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-09-03 13:24:16 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-09-03 13:24:16 +0000 |
commit | 574420fe8c452d83ab5ffc860669f35db4100bd2 (patch) | |
tree | 64766941b860460c47025b315bd7c7e9d1563367 | |
parent | 2aef19c4c0fd38641ccc54bd5946dd3103743749 (diff) | |
download | urpmi-574420fe8c452d83ab5ffc860669f35db4100bd2.tar urpmi-574420fe8c452d83ab5ffc860669f35db4100bd2.tar.gz urpmi-574420fe8c452d83ab5ffc860669f35db4100bd2.tar.bz2 urpmi-574420fe8c452d83ab5ffc860669f35db4100bd2.tar.xz urpmi-574420fe8c452d83ab5ffc860669f35db4100bd2.zip |
- fix _synthesis_dir() (from previous commit)
- create _url_with_synthesis_rel() out of _url_with_synthesis() and use it
- use sync_rel()
-rw-r--r-- | urpm/media.pm | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/urpm/media.pm b/urpm/media.pm index f23e2780..50a8b701 100644 --- a/urpm/media.pm +++ b/urpm/media.pm @@ -292,7 +292,7 @@ sub _synthesis_dir_rel { } sub _synthesis_dir { my ($medium) = @_; - my $rel = _synthesis_dir_rel($medium); + my $rel = _synthesis_dir_rel($medium) or return; my $base = file_from_local_medium($medium) || $medium->{url}; reduce_pathname("$base/$rel"); @@ -307,14 +307,20 @@ sub _valid_synthesis_dir { $dir && -d $dir; } -sub _url_with_synthesis { +sub _url_with_synthesis_rel { my ($medium) = @_; - my $base = file_from_local_medium($medium) || $medium->{url}; $medium->{with_synthesis} - ? reduce_pathname("$base/$medium->{with_synthesis}") - : _synthesis_dir($medium) . "/" . _url_with_synthesis_basename($medium); + ? $medium->{with_synthesis} + : "$medium->{media_info_dir}/synthesis.hdlist.cz"; + +} +sub _url_with_synthesis { + my ($medium) = @_; + my $rel = _url_with_synthesis_rel($medium) or return; + my $base = file_from_local_medium($medium) || $medium->{url}; + reduce_pathname("$base/$rel"); } sub synthesis { @@ -1196,14 +1202,14 @@ sub _download_media_info_file { if (_synthesis_suffix($medium)) { my $local_name = $prefix . _synthesis_suffix($medium) . $suffix; - if (urpm::download::sync($urpm, $medium, [_synthesis_dir($medium) . "/$local_name"], + if (urpm::download::sync_rel($urpm, $medium, [_synthesis_dir_rel($medium) . "/$local_name"], dir => $download_dir, quiet => $quiet, callback => $o_callback)) { rename("$download_dir/$local_name", $result_file); $found = 1; } } if (!$found) { - urpm::download::sync($urpm, $medium, [_synthesis_dir($medium) . "/$name"], + urpm::download::sync_rel($urpm, $medium, [_synthesis_dir_rel($medium) . "/$name"], dir => $download_dir, quiet => $quiet, callback => $o_callback) or unlink $result_file; } @@ -1272,7 +1278,7 @@ sub get_synthesis__remote { my ($urpm, $medium, $callback, $quiet) = @_; my $ok = try__maybe_mirrorlist($urpm, $medium, sub { - urpm::download::sync($urpm, $medium, [ _url_with_synthesis($medium) ], + urpm::download::sync_rel($urpm, $medium, [ _url_with_synthesis_rel($medium) ], quiet => $quiet, callback => $callback) && _check_synthesis(cachedir_with_synthesis($urpm, $medium)); }); |