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