summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2006-11-14 15:09:41 +0000
committerPascal Rigaux <pixel@mandriva.com>2006-11-14 15:09:41 +0000
commit23870113be2ae81ea14c89def359d9bc848dc5fa (patch)
treebbc767d16bb1a2ab4bdc208a5a7b8f94e1c63cd9 /urpm.pm
parent1a3a9bb3f623d22eb45b0168e3a1c358d2bf8aa7 (diff)
downloadurpmi-23870113be2ae81ea14c89def359d9bc848dc5fa.tar
urpmi-23870113be2ae81ea14c89def359d9bc848dc5fa.tar.gz
urpmi-23870113be2ae81ea14c89def359d9bc848dc5fa.tar.bz2
urpmi-23870113be2ae81ea14c89def359d9bc848dc5fa.tar.xz
urpmi-23870113be2ae81ea14c89def359d9bc848dc5fa.zip
- don't pass $basename to get_md5sum()
- cleanup
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm11
1 files changed, 6 insertions, 5 deletions
diff --git a/urpm.pm b/urpm.pm
index d3b30eba..75ac2a2a 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -262,7 +262,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", ($_->{synthesis} ? "synthesis." : "") . $_->{hdlist})) {
+ if (my $md5sum = get_md5sum("$urpm->{statedir}/MD5SUM", statedir_hdlist_or_synthesis($urpm, $_))) {
$_->{md5sum} = $md5sum;
}
}
@@ -3392,20 +3392,21 @@ sub get_updates_description {
#- parse an MD5SUM file from a mirror
sub get_md5sum {
- my ($path, $basename) = @_;
+ my ($md5sum_file, $f) = @_;
+ my $basename = basename($f);
my ($retrieved_md5sum) = map {
my ($md5sum, $file) = m|(\S+)\s+(?:\./)?(\S+)|;
$file && $file eq $basename ? $md5sum : @{[]};
- } cat_($path);
+ } cat_($md5sum_file);
$retrieved_md5sum;
}
sub parse_md5sum {
- my ($urpm, $path, $basename) = @_;
+ my ($urpm, $md5sum_file, $basename) = @_;
$urpm->{log}(N("examining MD5SUM file"));
- my $retrieved_md5sum = get_md5sum($path, $basename)
+ my $retrieved_md5sum = get_md5sum($md5sum_file, $basename)
or $urpm->{log}(N("warning: md5sum for %s unavailable in MD5SUM file", $basename));
return $retrieved_md5sum;
}