fix removeKey when not present
This commit is contained in:
		
					parent
					
						
							
								6cb9e5c32f
							
						
					
				
			
			
				commit
				
					
						0260ee43e6
					
				
			
		
					 1 changed files with 10 additions and 3 deletions
				
			
		|  | @ -128,9 +128,16 @@ remove Nothing _ = return False | ||||||
| remove (Just dav) k = liftIO $ do | remove (Just dav) k = liftIO $ do | ||||||
| 	-- Delete the key's whole directory, including any | 	-- Delete the key's whole directory, including any | ||||||
| 	-- legacy chunked files, etc, in a single action. | 	-- legacy chunked files, etc, in a single action. | ||||||
| 	ret <- goDAV dav $ safely $ | 	let d = keyDir k | ||||||
| 		inLocation (keyDir k) delContentM | 	goDAV dav $ do | ||||||
| 	return (isJust ret) | 		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 :: Remote -> ChunkConfig -> Maybe DavHandle -> CheckPresent | ||||||
| checkKey r _ Nothing _ = error $ name r ++ " not configured" | checkKey r _ Nothing _ = error $ name r ++ " not configured" | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Joey Hess
				Joey Hess