Lines 423-428
sub Download (@)
Link Here
|
423 |
if ( ! -f $candidate) |
423 |
if ( ! -f $candidate) |
424 |
{ |
424 |
{ |
425 |
push @missing, $entry; |
425 |
push @missing, $entry; |
|
|
426 |
print "downloading $candidate\n"; |
427 |
} |
428 |
else |
429 |
{ |
430 |
open(my $cur_oxt, $candidate) or next; # TODO die or next? |
431 |
binmode($cur_oxt); |
432 |
my $file_md5 = Digest::MD5->new->addfile(*$cur_oxt)->hexdigest; |
433 |
close($cur_oxt); |
434 |
if ($md5sum ne $file_md5) |
435 |
{ |
436 |
push @missing, $entry; |
437 |
print "updating $candidate\n"; |
438 |
unlink($candidate); # needed? rename overwrites, at least in Linux |
439 |
} |
426 |
} |
440 |
} |
427 |
} |
441 |
} |
428 |
if ($#missing >= 0) |
442 |
if ($#missing >= 0) |