From a566ef1448bf2ad582308ea0d88a9f323aa24f22 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 26 Jul 2014 22:25:50 -0400 Subject: fix fallback to other chunk size when first does not have it --- Remote/Helper/Chunked.hs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'Remote/Helper/Chunked.hs') diff --git a/Remote/Helper/Chunked.hs b/Remote/Helper/Chunked.hs index 18dfe8aee..baf47f067 100644 --- a/Remote/Helper/Chunked.hs +++ b/Remote/Helper/Chunked.hs @@ -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) -- cgit v1.2.3