fix non-checked hasKeyChunks

This commit is contained in:
Joey Hess 2014-07-29 15:07:32 -04:00
parent 2474cf0032
commit 216fdbd6bd

View file

@ -320,21 +320,20 @@ hasKeyChunks checker u chunkconfig encryptor basek
-- that are likely not there. -- that are likely not there.
ifM ((Right True ==) <$> checker (encryptor basek)) ifM ((Right True ==) <$> checker (encryptor basek))
( return (Right True) ( return (Right True)
, checklists impossible =<< chunkKeysOnly u basek , checklists Nothing =<< chunkKeysOnly u basek
) )
| otherwise = checklists impossible =<< chunkKeys u chunkconfig basek | otherwise = checklists Nothing =<< chunkKeys u chunkconfig basek
where where
checklists lastfailmsg [] = return $ Left lastfailmsg checklists Nothing [] = return (Right False)
checklists _ (l:ls) checklists (Just deferrederror) [] = return (Left deferrederror)
checklists d (l:ls)
| not (null l) = do | not (null l) = do
v <- checkchunks l v <- checkchunks l
case v of case v of
Left e -> checklists e ls Left e -> checklists (Just e) ls
Right True -> return (Right True) Right True -> return (Right True)
Right False Right False -> checklists Nothing ls
| null ls -> return (Right False) | otherwise = checklists d ls
| otherwise -> checklists impossible ls
| otherwise = checklists impossible ls
checkchunks :: [Key] -> Annex (Either String Bool) checkchunks :: [Key] -> Annex (Either String Bool)
checkchunks [] = return (Right True) checkchunks [] = return (Right True)
@ -344,8 +343,6 @@ hasKeyChunks checker u chunkconfig encryptor basek
then checkchunks ks then checkchunks ks
else return v else return v
impossible = "no recorded chunks"
{- A key can be stored in a remote unchunked, or as a list of chunked keys. {- A key can be stored in a remote unchunked, or as a list of chunked keys.
- This can be the case whether or not the remote is currently configured - This can be the case whether or not the remote is currently configured
- to use chunking. - to use chunking.