summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-03-31 09:08:42 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-03-31 09:08:42 +0000
commit68f329029d6b5968cf743f183f3794caf66eeda6 (patch)
treef608d6ec7c8b7a9507acd2d743dc90e8587c4e01 /urpm
parent9e2564c4598b0af5d7807774f45cac752dbe63d6 (diff)
downloadurpmi-68f329029d6b5968cf743f183f3794caf66eeda6.tar
urpmi-68f329029d6b5968cf743f183f3794caf66eeda6.tar.gz
urpmi-68f329029d6b5968cf743f183f3794caf66eeda6.tar.bz2
urpmi-68f329029d6b5968cf743f183f3794caf66eeda6.tar.xz
urpmi-68f329029d6b5968cf743f183f3794caf66eeda6.zip
create _maybe_in_statedir_MD5SUM() out of _any_media_info__or_download() for next commit
Diffstat (limited to 'urpm')
-rw-r--r--urpm/media.pm11
1 files changed, 8 insertions, 3 deletions
diff --git a/urpm/media.pm b/urpm/media.pm
index 09d9edae..950a5a56 100644
--- a/urpm/media.pm
+++ b/urpm/media.pm
@@ -1617,6 +1617,13 @@ sub update_media {
$updates_result{error} == 0;
}
+sub _maybe_in_statedir_MD5SUM {
+ my ($urpm, $medium, $file) = @_;
+
+ my $md5sum_file = statedir_MD5SUM($urpm, $medium);
+ -e $md5sum_file && urpm::md5sum::parse($md5sum_file)->{$file};
+}
+
sub _retrieve_xml_media_info_or_remove {
my ($urpm, $medium, $quiet) = @_;
@@ -1677,9 +1684,7 @@ sub _any_media_info__or_download {
get_medium_option($urpm, $medium, 'xml-info') ne 'never' or return;
- my $md5sum_file = statedir_MD5SUM($urpm, $medium);
- -e $md5sum_file &&
- urpm::md5sum::parse($md5sum_file)->{"$prefix$suffix"} or return;
+ _maybe_in_statedir_MD5SUM($urpm, $medium, "$prefix$suffix") or return;
my $file_in_partial =
_download_media_info_file($urpm, $medium, $prefix, $suffix, $quiet, $download_dir, $o_callback) or return;