From 51a3747830e9c3a966185977b50652a928b3ee84 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 29 Jul 2014 15:07:32 -0400 Subject: fix non-checked hasKeyChunks --- Remote/Helper/Chunked.hs | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/Remote/Helper/Chunked.hs b/Remote/Helper/Chunked.hs index 3f591ae39..708d87800 100644 --- a/Remote/Helper/Chunked.hs +++ b/Remote/Helper/Chunked.hs @@ -320,21 +320,20 @@ hasKeyChunks checker u chunkconfig encryptor basek -- that are likely not there. ifM ((Right True ==) <$> checker (encryptor basek)) ( 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 - checklists lastfailmsg [] = return $ Left lastfailmsg - checklists _ (l:ls) + checklists Nothing [] = return (Right False) + checklists (Just deferrederror) [] = return (Left deferrederror) + checklists d (l:ls) | not (null l) = do v <- checkchunks l case v of - Left e -> checklists e ls + Left e -> checklists (Just e) ls Right True -> return (Right True) - Right False - | null ls -> return (Right False) - | otherwise -> checklists impossible ls - | otherwise = checklists impossible ls + Right False -> checklists Nothing ls + | otherwise = checklists d ls checkchunks :: [Key] -> Annex (Either String Bool) checkchunks [] = return (Right True) @@ -344,8 +343,6 @@ hasKeyChunks checker u chunkconfig encryptor basek then checkchunks ks else return v - impossible = "no recorded chunks" - {- 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 - to use chunking. -- cgit v1.2.3