projects
/
cloudstore.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e566496
)
better check of md5sum files
author
Dobrica Pavlinusic
<dpavlin@rsync1.maxxo.com>
Mon, 21 May 2012 09:00:07 +0000
(11:00 +0200)
committer
Dobrica Pavlinusic
<dpavlin@rsync1.maxxo.com>
Mon, 21 May 2012 09:00:07 +0000
(11:00 +0200)
lib/CloudStore/Store.pm
patch
|
blob
|
history
diff --git
a/lib/CloudStore/Store.pm
b/lib/CloudStore/Store.pm
index
1956a73
..
3969c48
100644
(file)
--- a/
lib/CloudStore/Store.pm
+++ b/
lib/CloudStore/Store.pm
@@
-327,8
+327,8
@@
sub md5pool {
my $md5 = $data->{md5} || die "no md5 in ",dump $data;
my $path = $self->blob_path($data);
- if ( ! -
e
$path ) {
- warn "ERROR missing path $path";
+ if ( ! -
f
$path ) {
+ warn "ERROR missing path $path
: $!
";
return;
}
@@
-377,8
+377,8
@@
sub dedup {
while(<$md5sum>) {
chomp;
my ( $md5, $file ) = split(/\s+/,$_,2);
- if ( ! $file ) {
- warn "
IGNORE $md5 without file\n"
;
+ if (
$md5 !~ /^[0-9a-f]{32}$/i ||
! $file ) {
+ warn "
ERROR corrupt md5sum line ",dump($_)
;
next;
}
if ( ! -e "$self->{md5pool}/$md5" ) {