diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2006-11-21 15:50:20 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2006-11-21 15:50:20 +0000 |
commit | c17798ddc4bf5740bbc31fd6d0e281c18f62dd26 (patch) | |
tree | 0dee39bb94cf2fd42153b53a0de0ee384f085d5b /urpm.pm | |
parent | 27a93cf55b90718343727a7643d3864884dafe60 (diff) | |
download | urpmi-c17798ddc4bf5740bbc31fd6d0e281c18f62dd26.tar urpmi-c17798ddc4bf5740bbc31fd6d0e281c18f62dd26.tar.gz urpmi-c17798ddc4bf5740bbc31fd6d0e281c18f62dd26.tar.bz2 urpmi-c17798ddc4bf5740bbc31fd6d0e281c18f62dd26.tar.xz urpmi-c17798ddc4bf5740bbc31fd6d0e281c18f62dd26.zip |
- rename get_md5sum() into from_MD5SUM()
- rename parse_md5sum() into from_MD5SUM__or_warn()
- in from_MD5SUM__or_warn(), display the name of the MD5SUM file used
Diffstat (limited to 'urpm.pm')
-rw-r--r-- | urpm.pm | 16 |
1 files changed, 7 insertions, 9 deletions
@@ -276,7 +276,7 @@ sub read_config { #- read MD5 sums (usually not in urpmi.cfg but in a separate file) foreach (@{$urpm->{media}}) { - if (my $md5sum = get_md5sum("$urpm->{statedir}/MD5SUM", statedir_hdlist_or_synthesis($urpm, $_))) { + if (my $md5sum = from_MD5SUM("$urpm->{statedir}/MD5SUM", statedir_hdlist_or_synthesis($urpm, $_))) { $_->{md5sum} = $md5sum; } } @@ -1469,9 +1469,7 @@ this could happen if you mounted manually the directory when creating the medium my ($retrieved_md5sum); if (!$options->{nomd5sum} && file_size(_hdlist_dir($medium) . '/MD5SUM') > 32) { - #- get md5sum even if there is no local md5sum to compare with, - #- since $retrieved_md5sum is needed to write into /var/lib/urpmi/MD5SUM - $retrieved_md5sum = parse_md5sum($urpm, _hdlist_dir($medium) . '/MD5SUM', basename($medium->{with_hdlist})); + $retrieved_md5sum = from_MD5SUM__or_warn($urpm, _hdlist_dir($medium) . '/MD5SUM', basename($medium->{with_hdlist})); if (local_md5sum($urpm, $medium, $options->{force})) { _read_existing_synthesis_and_hdlist_if_same_md5sum($urpm, $medium, $retrieved_md5sum) and return 'unmodified'; @@ -1534,7 +1532,7 @@ sub _update_medium__parse_if_unmodified__remote { [ reduce_pathname(_hdlist_dir($medium) . '/MD5SUM') ], quiet => 1) && file_size("$urpm->{cachedir}/partial/MD5SUM") > 32) { if (local_md5sum($urpm, $medium, $options->{force} >= 2)) { - $retrieved_md5sum = parse_md5sum($urpm, "$urpm->{cachedir}/partial/MD5SUM", $basename); + $retrieved_md5sum = from_MD5SUM__or_warn($urpm, "$urpm->{cachedir}/partial/MD5SUM", $basename); _read_existing_synthesis_and_hdlist_if_same_md5sum($urpm, $medium, $retrieved_md5sum) and return 'unmodified'; } @@ -3181,7 +3179,7 @@ sub get_updates_description { } #- parse an MD5SUM file from a mirror -sub get_md5sum { +sub from_MD5SUM { my ($md5sum_file, $f) = @_; my $basename = basename($f); @@ -3193,10 +3191,10 @@ sub get_md5sum { $retrieved_md5sum; } -sub parse_md5sum { +sub from_MD5SUM__or_warn { my ($urpm, $md5sum_file, $basename) = @_; - $urpm->{log}(N("examining MD5SUM file")); - my $retrieved_md5sum = get_md5sum($md5sum_file, $basename) + $urpm->{log}(N("examining %s file", $md5sum_file)); + my $retrieved_md5sum = from_MD5SUM($md5sum_file, $basename) or $urpm->{log}(N("warning: md5sum for %s unavailable in MD5SUM file", $basename)); return $retrieved_md5sum; } |