diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-09-22 15:40:25 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-09-22 15:40:25 +0000 |
commit | a1dca5cbe9076b19ca716ed6d66f7ba6670302d4 (patch) | |
tree | f62b3c0e7a414b824e65647d59452b36cfdadcae /urpm | |
parent | 23052247a36cf831133504fdf0819fa054ce9912 (diff) | |
download | urpmi-a1dca5cbe9076b19ca716ed6d66f7ba6670302d4.tar urpmi-a1dca5cbe9076b19ca716ed6d66f7ba6670302d4.tar.gz urpmi-a1dca5cbe9076b19ca716ed6d66f7ba6670302d4.tar.bz2 urpmi-a1dca5cbe9076b19ca716ed6d66f7ba6670302d4.tar.xz urpmi-a1dca5cbe9076b19ca716ed6d66f7ba6670302d4.zip |
prepare next commits: introduce $medium->{parsed_md5sum}
Diffstat (limited to 'urpm')
-rw-r--r-- | urpm/md5sum.pm | 4 | ||||
-rw-r--r-- | urpm/media.pm | 8 |
2 files changed, 7 insertions, 5 deletions
diff --git a/urpm/md5sum.pm b/urpm/md5sum.pm index 855bfdd1..cecd5300 100644 --- a/urpm/md5sum.pm +++ b/urpm/md5sum.pm @@ -22,9 +22,7 @@ sub check_file { } sub from_MD5SUM__or_warn { - my ($urpm, $md5sum_file, $basename) = @_; - $urpm->{debug}(N("examining %s file", $md5sum_file)) if $urpm->{debug}; - my $md5sums = parse($md5sum_file) or $urpm->{log}(N("invalid MD5SUM file")), return; + my ($urpm, $md5sums, $basename) = @_; $md5sums->{$basename} or $urpm->{log}(N("warning: md5sum for %s unavailable in MD5SUM file", $basename)); $md5sums->{$basename}; } diff --git a/urpm/media.pm b/urpm/media.pm index f88774ba..16e7b5f1 100644 --- a/urpm/media.pm +++ b/urpm/media.pm @@ -1303,7 +1303,7 @@ sub _check_synthesis { sub check_synthesis_md5sum { my ($urpm, $medium) = @_; - my $wanted_md5sum = urpm::md5sum::from_MD5SUM__or_warn($urpm, "$urpm->{cachedir}/partial/MD5SUM", 'synthesis.hdlist.cz'); + my $wanted_md5sum = urpm::md5sum::from_MD5SUM__or_warn($urpm, $medium->{parsed_md5sum}, 'synthesis.hdlist.cz'); if ($wanted_md5sum) { $urpm->{log}(N("computing md5sum of retrieved source synthesis")); urpm::md5sum::compute(cachedir_with_synthesis($urpm, $medium)) eq $wanted_md5sum or @@ -1385,6 +1385,7 @@ sub _update_medium__parse_if_unmodified__local { $urpm->{log}(N("copying MD5SUM file of \"%s\"...", $medium->{name})); copy_and_own($new_MD5SUM, "$urpm->{cachedir}/partial/MD5SUM"); + $medium->{parsed_md5sum} = urpm::md5sum::parse($new_MD5SUM); } my $ok = get_synthesis__local($urpm, $medium, $options->{callback}); @@ -1446,6 +1447,7 @@ sub _update_medium__parse_if_unmodified__remote { _medium_is_up_to_date($urpm, $medium); return 'unmodified'; } + $medium->{parsed_md5sum} = urpm::md5sum::parse($new_MD5SUM); } #- try to probe for possible with_synthesis parameter, unless @@ -1704,6 +1706,8 @@ sub _retrieve_xml_media_info_or_remove { sub _retrieve_media_info_file_and_check_MD5SUM { my ($urpm, $medium, $prefix, $suffix, $quiet) = @_; + $medium->{parsed_md5sum} = urpm::md5sum::parse(statedir_MD5SUM($urpm, $medium)); + my $name = "$prefix$suffix"; my $cachedir_file = is_local_medium($medium) ? @@ -1711,7 +1715,7 @@ sub _retrieve_media_info_file_and_check_MD5SUM { _download_media_info_file($urpm, $medium, $prefix, $suffix, $quiet) or $urpm->{error}(N("retrieval of [%s] failed", _synthesis_dir($medium) . "/$name")), return; - my $wanted_md5sum = urpm::md5sum::from_MD5SUM__or_warn($urpm, statedir_MD5SUM($urpm, $medium), $name); + my $wanted_md5sum = urpm::md5sum::from_MD5SUM__or_warn($urpm, $medium->{parsed_md5sum}, $name); if ($wanted_md5sum) { $urpm->{debug}("computing md5sum of retrieved $name") if $urpm->{debug}; urpm::md5sum::compute($cachedir_file) eq $wanted_md5sum or |