diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-09-23 15:54:24 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-09-23 15:54:24 +0000 |
commit | ab25ce721b7bf62841c6d9c1ded8a762fb717784 (patch) | |
tree | acb3d6303153823b69308219646ba8c5b65214c4 /urpm/md5sum.pm | |
parent | 0ff68bc2ce17ed97d22575c250c1d569638c1801 (diff) | |
download | urpmi-ab25ce721b7bf62841c6d9c1ded8a762fb717784.tar urpmi-ab25ce721b7bf62841c6d9c1ded8a762fb717784.tar.gz urpmi-ab25ce721b7bf62841c6d9c1ded8a762fb717784.tar.bz2 urpmi-ab25ce721b7bf62841c6d9c1ded8a762fb717784.tar.xz urpmi-ab25ce721b7bf62841c6d9c1ded8a762fb717784.zip |
- use "versioned" media_info files
(needed for aria2 to handle mirrors not having some media_info/*)
it fixes:
- downloading parts of media_info file from different mirrors and failing to
obtain a valid result
- checking md5sum of media_info files
Diffstat (limited to 'urpm/md5sum.pm')
-rw-r--r-- | urpm/md5sum.pm | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/urpm/md5sum.pm b/urpm/md5sum.pm index cecd5300..b2fe7a0c 100644 --- a/urpm/md5sum.pm +++ b/urpm/md5sum.pm @@ -27,6 +27,20 @@ sub from_MD5SUM__or_warn { $md5sums->{$basename}; } +sub versioned_media_info_file { + my ($urpm, $medium, $basename) = @_; + my $md5sums = $medium->{parsed_md5sum} or $urpm->{log}("$medium->{name} has no md5sum"), return; + + my @l = map { $md5sums->{$_} eq $md5sums->{$basename} && /^(\d{8}-\d{6})-\Q$basename\E$/ ? $1 : () } keys %$md5sums; + + if (@l == 0) { + $urpm->{debug}("no versioned $basename for medium $medium->{name}") if $urpm->{debug}; + } else { + @l > 1 and $urpm->{debug}("multiple versions for $basename for medium $medium->{name}: @l") if $urpm->{debug}; + } + $l[0]; +} + sub compute { my ($file) = @_; eval { require Digest::MD5 }; |