Skip to content

Commit

Permalink
FileChecker::checkFromDroidOutput(): catch and report as ordinary err…
Browse files Browse the repository at this point in the history
…or if the file was removed in the meantime
  • Loading branch information
zozlak committed Aug 26, 2024
1 parent 6f8355f commit 29cd2bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/acdhOeaw/arche/fileChecker/FileChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,9 +183,12 @@ private function checkFromDroidOutput(string $droidOutput, string $continue): vo
$this->progressBar->advance();
continue;
}
if (!file_exists($fileInfo->path)) {
$fileInfo->error('Removed', "File removed during the filechecker run");
}
$this->runChecks($fileInfo, $this->checksFile);

if (!is_link($fileInfo->path)) {
if (!is_link($fileInfo->path) && file_exists($fileInfo->path)) {
$hash = $this->computeHash($fileInfo->path);
if (isset($hashes[$hash])) {
$fileInfo->error("Duplicated file", "Same hash as " . substr($hashes[$hash], strlen($this->checkDir) + 1));
Expand Down
1 change: 0 additions & 1 deletion src/acdhOeaw/arche/fileChecker/FileInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ static public function fromDroid(array $data) {
break;
}


return $fi;
}

Expand Down

0 comments on commit 29cd2bd

Please sign in to comment.