diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-09-23 07:26:26 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-09-23 07:26:26 +0000 |
commit | 367f0ff1ed2653ad0bfb62ba9156aea78eb24803 (patch) | |
tree | a49389e58a64dc0d1625bbeb801eaa75ffe4251f /urpm/download.pm | |
parent | a1dca5cbe9076b19ca716ed6d66f7ba6670302d4 (diff) | |
download | urpmi-367f0ff1ed2653ad0bfb62ba9156aea78eb24803.tar urpmi-367f0ff1ed2653ad0bfb62ba9156aea78eb24803.tar.gz urpmi-367f0ff1ed2653ad0bfb62ba9156aea78eb24803.tar.bz2 urpmi-367f0ff1ed2653ad0bfb62ba9156aea78eb24803.tar.xz urpmi-367f0ff1ed2653ad0bfb62ba9156aea78eb24803.zip |
- normalize synthesis downloading: rename it in cachedir asap just like any other media_info files
- create urpm::download::sync_rel_to()
Diffstat (limited to 'urpm/download.pm')
-rw-r--r-- | urpm/download.pm | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/urpm/download.pm b/urpm/download.pm index c1b07820..fe6097dd 100644 --- a/urpm/download.pm +++ b/urpm/download.pm @@ -836,6 +836,21 @@ sub sync_url { sync_rel($urpm, { url => dirname($url) }, [basename($url)], %options); } +sub sync_rel_to { + my ($urpm, $medium, $rel_file, $dest_file, %options) = @_; + + my $download_dir = $options{dir} || "$urpm->{cachedir}/partial"; + my $result_file = "$download_dir/" . basename($rel_file); + + if (sync_rel($urpm, $medium, [$rel_file], %options)) { + $result_file ne $dest_file or rename($result_file, $dest_file) or return; + 1; + } else { + unlink $result_file; + undef; + } +} + #- deprecated, use sync_url() or sync_rel() instead #- #- $medium can be undef |