summaryrefslogtreecommitdiff
path: root/Remote
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2014-07-29 15:07:32 -0400
committerGravatar Joey Hess <joey@kitenet.net>2014-07-29 15:07:32 -0400
commit51a3747830e9c3a966185977b50652a928b3ee84 (patch)
tree0f39f6bb63aab242e847d04bfcb3c8f1962dc4e2 /Remote
parentdc2369a437b14d4ea6a84d8b756c8b11db15fc85 (diff)
fix non-checked hasKeyChunks
Diffstat (limited to 'Remote')
-rw-r--r--Remote/Helper/Chunked.hs19
1 files 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.