fix fallback to other chunk size when first does not have it

This commit is contained in:
Joey Hess 2014-07-26 22:25:50 -04:00
parent 275e284dda
commit 67975bf50d

View file

@ -221,14 +221,17 @@ hasKeyChunks
-> EncKey -> EncKey
-> Key -> Key
-> Annex (Either String Bool) -> Annex (Either String Bool)
hasKeyChunks checker u chunkconfig encryptor basek = hasKeyChunks checker u chunkconfig encryptor basek = do
checklists impossible =<< chunkKeys u chunkconfig basek checklists impossible =<< chunkKeys u chunkconfig basek
where where
checklists lastfailmsg [] = return $ Left lastfailmsg checklists lastfailmsg [] = return $ Left lastfailmsg
checklists _ (l:ls) checklists _ (l:ls)
| not (null l) = | not (null l) = do
either (`checklists` ls) (return . Right) v <- checkchunks l
=<< checkchunks l case v of
Left e -> checklists e ls
Right True -> return (Right True)
Right False -> checklists impossible ls
| otherwise = checklists impossible ls | otherwise = checklists impossible ls
checkchunks :: [Key] -> Annex (Either String Bool) checkchunks :: [Key] -> Annex (Either String Bool)