Skip to content
Snippets Groups Projects
Commit 617c8934 authored by Andreas Romeyke's avatar Andreas Romeyke
Browse files

- avoid fixity- and size check if files does not exist

parent 0be6fa35
No related branches found
No related tags found
No related merge requests found
...@@ -322,12 +322,14 @@ if (defined $search_dir && -d "$search_dir") { ...@@ -322,12 +322,14 @@ if (defined $search_dir && -d "$search_dir") {
my $result; my $result;
$result->{errors} = 0; $result->{errors} = 0;
$result = check_if_file_exist($fileobj, $result); $result = check_if_file_exist($fileobj, $result);
if ($result->{exist}) { # only if file exists, do additional checks
$result = check_file_size($fileobj, $result); $result = check_file_size($fileobj, $result);
foreach my $fixity_algorithm (@algorithms) { foreach my $fixity_algorithm (@algorithms) {
if ($fileobj->{fixity}->{$fixity_algorithm}) { if ($fileobj->{fixity}->{$fixity_algorithm}) {
$result = check_file_fixity($fileobj, $result, $fixity_algorithm); $result = check_file_fixity($fileobj, $result, $fixity_algorithm);
} }
} }
}
if ($result->{errors} > 0) { if ($result->{errors} > 0) {
path($report_file)->append_utf8("IE $_ with following errors:\n"); path($report_file)->append_utf8("IE $_ with following errors:\n");
foreach my $errors (@{ $result->{error_description} }) { foreach my $errors (@{ $result->{error_description} }) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment