check key size when available, no matter the backend

Now that SHA and other backends can have size info, fsck should check it
whenever available.
This commit is contained in:
Joey Hess 2011-03-23 02:10:59 -04:00
parent 12cdc96216
commit c43e3b5c78
3 changed files with 43 additions and 29 deletions

View file

@ -38,7 +38,7 @@ backend = Backend {
retrieveKeyFile = copyKeyFile,
removeKey = checkRemoveKey,
hasKey = inAnnex,
fsckKey = mustProvide
fsckKey = checkKeyOnly
}
mustProvide :: a
@ -172,6 +172,9 @@ checkKey a key file numcopies = do
copies_ok <- checkKeyNumCopies key file numcopies
return $ a_ok && copies_ok
checkKeyOnly :: Key -> Maybe FilePath -> Maybe Int -> Annex Bool
checkKeyOnly = checkKey (\_ -> return True)
checkKeyNumCopies :: Key -> Maybe FilePath -> Maybe Int -> Annex Bool
checkKeyNumCopies key file numcopies = do
needed <- getNumCopies numcopies