diff options
-rw-r--r-- | urpm.pm | 13 |
1 files changed, 5 insertions, 8 deletions
@@ -1430,8 +1430,7 @@ this could happen if you mounted manually the directory when creating the medium unless ($medium->{virtual}) { if ($medium->{with_hdlist}) { if (!$options->{nomd5sum} && file_size(_hdlist_dir($medium) . '/MD5SUM') > 32) { - recompute_local_md5sum($urpm, $medium, $options->{force}); - if ($medium->{md5sum}) { + if (recompute_local_md5sum($urpm, $medium, $options->{force})) { $retrieved_md5sum = parse_md5sum($urpm, _hdlist_dir($medium) . '/MD5SUM', basename($medium->{with_hdlist})); _read_existing_synthesis_and_hdlist_if_same_md5sum($urpm, $medium, $retrieved_md5sum) and return 'unmodified'; @@ -1554,8 +1553,7 @@ sub _update_medium__parse_if_unmodified__or_get_files__remote { sync_webfetch($urpm, $medium, [ reduce_pathname(_hdlist_dir($medium) . '/MD5SUM') ], quiet => 1) && file_size("$urpm->{cachedir}/partial/MD5SUM") > 32) { - recompute_local_md5sum($urpm, $medium, $options->{force} >= 2); - if ($medium->{md5sum}) { + if (recompute_local_md5sum($urpm, $medium, $options->{force} >= 2)) { $retrieved_md5sum = parse_md5sum($urpm, "$urpm->{cachedir}/partial/MD5SUM", $basename); _read_existing_synthesis_and_hdlist_if_same_md5sum($urpm, $medium, $retrieved_md5sum) and return 'unmodified'; @@ -3301,8 +3299,9 @@ sub recompute_local_md5sum { #- force downloading the file again, else why a force option has been defined ? delete $medium->{md5sum}; } else { - compute_local_md5sum($urpm, $medium) if !$medium->{md5sum}; + $medium->{md5sum} ||= compute_local_md5sum($urpm, $medium); } + $medium->{md5sum}; } sub compute_local_md5sum { @@ -3310,9 +3309,7 @@ sub compute_local_md5sum { $urpm->{log}(N("computing md5sum of existing source hdlist (or synthesis)")); my $f = statedir_hdlist_or_synthesis($urpm, $medium); - if (-e $f) { - $medium->{md5sum} = md5sum($f); - } + -e $f && md5sum($f); } sub syserror { my ($urpm, $msg, $info) = @_; $urpm->{error}("$msg [$info] [$!]") } |