fix removeKey when not present

This commit is contained in:
Joey Hess 2014-08-08 14:57:05 -04:00
parent 6cb9e5c32f
commit 0260ee43e6

View file

@ -128,9 +128,16 @@ remove Nothing _ = return False
remove (Just dav) k = liftIO $ do
-- Delete the key's whole directory, including any
-- legacy chunked files, etc, in a single action.
ret <- goDAV dav $ safely $
inLocation (keyDir k) delContentM
return (isJust ret)
let d = keyDir k
goDAV dav $ do
v <- safely $ inLocation d delContentM
case v of
Just _ -> return True
Nothing -> do
v' <- existsDAV d
case v' of
Right False -> return True
_ -> return False
checkKey :: Remote -> ChunkConfig -> Maybe DavHandle -> CheckPresent
checkKey r _ Nothing _ = error $ name r ++ " not configured"