fsck improvements
This commit is contained in:
parent
5fa25a812a
commit
abebbcfd54
4 changed files with 30 additions and 14 deletions
|
@ -169,10 +169,18 @@ checkKey a key = do
|
|||
|
||||
checkKeyNumCopies :: Key -> Annex Bool
|
||||
checkKeyNumCopies key = do
|
||||
needed <- getNumCopies
|
||||
remotes <- Remotes.keyPossibilities key
|
||||
numcopies <- getNumCopies
|
||||
if (length remotes < numcopies)
|
||||
inannex <- inAnnex key
|
||||
let present = length remotes + if inannex then 1 else 0
|
||||
if (present < needed)
|
||||
then do
|
||||
showLongNote $ "only " ++ show (length remotes) ++ " of " ++ show numcopies ++ " copies"
|
||||
showLongNote $ note present needed
|
||||
return False
|
||||
else return True
|
||||
where
|
||||
note 0 _ = "** No known copies of the file exist!"
|
||||
note present needed =
|
||||
"Only " ++ show present ++ " of " ++ show needed ++
|
||||
" copies exist. " ++
|
||||
"Run git annex get somewhere else to back it up."
|
||||
|
|
|
@ -57,5 +57,5 @@ checkKeySHA1 key = do
|
|||
then return True
|
||||
else do
|
||||
dest <- moveBad key
|
||||
showNote $ "bad file content (moved to "++dest++")"
|
||||
showLongNote $ "Bad file content; moved to "++dest
|
||||
return False
|
||||
|
|
|
@ -66,5 +66,5 @@ checkKeySize key = do
|
|||
then return True
|
||||
else do
|
||||
dest <- moveBad key
|
||||
showNote $ "bad file size (moved to "++dest++")"
|
||||
showLongNote $ "Bad file size; moved to "++dest
|
||||
return False
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue