diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-01-08 14:23:20 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-01-08 14:23:20 +0000 |
commit | 5546d07c8b3f323efdbbd01225f86992f6220b08 (patch) | |
tree | 2e3878554e29446120f3da3dd111f8f85bc0c346 /urpm | |
parent | 312accc79ce787e5d1b57533f28e512a382e0c92 (diff) | |
download | urpmi-5546d07c8b3f323efdbbd01225f86992f6220b08.tar urpmi-5546d07c8b3f323efdbbd01225f86992f6220b08.tar.gz urpmi-5546d07c8b3f323efdbbd01225f86992f6220b08.tar.bz2 urpmi-5546d07c8b3f323efdbbd01225f86992f6220b08.tar.xz urpmi-5546d07c8b3f323efdbbd01225f86992f6220b08.zip |
create _download_MD5SUM() out of _update_medium__parse_if_unmodified__remote() for future use
Diffstat (limited to 'urpm')
-rw-r--r-- | urpm/media.pm | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/urpm/media.pm b/urpm/media.pm index aa9c29ec..613ee6a5 100644 --- a/urpm/media.pm +++ b/urpm/media.pm @@ -1133,6 +1133,16 @@ this could happen if you mounted manually the directory when creating the medium } } +sub _download_MD5SUM { + my ($urpm, $medium) = @_; + + my $cachedir_MD5SUM = "$urpm->{cachedir}/partial/MD5SUM"; + unlink $cachedir_MD5SUM; + urpm::download::sync($urpm, $medium, + [ reduce_pathname(_synthesis_dir($medium) . '/MD5SUM') ], + quiet => 1) && file_size($cachedir_MD5SUM) > 32; +} + #- options: callback, force, nomd5sum, probe_with, quiet sub _update_medium__parse_if_unmodified__remote { my ($urpm, $medium, $options) = @_; @@ -1146,12 +1156,8 @@ sub _update_medium__parse_if_unmodified__remote { #- to be checked for being valid, nothing can be deduced if no MD5SUM #- file is present. - my $new_MD5SUM = "$urpm->{cachedir}/partial/MD5SUM"; - unlink $new_MD5SUM; - if (!$options->{nomd5sum} && - urpm::download::sync($urpm, $medium, - [ reduce_pathname(_synthesis_dir($medium) . '/MD5SUM') ], - quiet => 1) && file_size($new_MD5SUM) > 32) { + if (!$options->{nomd5sum} && _download_MD5SUM($urpm, $medium)) { + my $new_MD5SUM = "$urpm->{cachedir}/partial/MD5SUM"; if ($options->{force} < 2 && _is_statedir_MD5SUM_uptodate($urpm, $medium, $new_MD5SUM)) { _read_existing_synthesis($urpm, $medium) and return 'unmodified'; |