consistency
This commit is contained in:
parent
570899ed0c
commit
921313bcc7
1 changed files with 4 additions and 4 deletions
|
@ -56,7 +56,7 @@ retrieveFile state file dest = do
|
||||||
case (result) of
|
case (result) of
|
||||||
Nothing -> return False
|
Nothing -> return False
|
||||||
Just b -> do
|
Just b -> do
|
||||||
key <- lookupKey b state file
|
key <- lookupKey state b file
|
||||||
(retrieveKeyFile b) state key dest
|
(retrieveKeyFile b) state key dest
|
||||||
|
|
||||||
{- Drops the key for a file from the backend that has it. -}
|
{- Drops the key for a file from the backend that has it. -}
|
||||||
|
@ -66,7 +66,7 @@ dropFile state file = do
|
||||||
case (result) of
|
case (result) of
|
||||||
Nothing -> return Nothing
|
Nothing -> return Nothing
|
||||||
Just b -> do
|
Just b -> do
|
||||||
key <- lookupKey b state file
|
key <- lookupKey state b file
|
||||||
(removeKey b) state key
|
(removeKey b) state key
|
||||||
removeFile $ backendFile state b file
|
removeFile $ backendFile state b file
|
||||||
return $ Just key
|
return $ Just key
|
||||||
|
@ -95,8 +95,8 @@ checkBackend :: Backend -> State -> FilePath -> IO (Bool)
|
||||||
checkBackend backend state file = doesFileExist $ backendFile state backend file
|
checkBackend backend state file = doesFileExist $ backendFile state backend file
|
||||||
|
|
||||||
{- Looks up the key a backend uses for an already annexed file. -}
|
{- Looks up the key a backend uses for an already annexed file. -}
|
||||||
lookupKey :: Backend -> State -> FilePath -> IO Key
|
lookupKey :: State -> Backend -> FilePath -> IO Key
|
||||||
lookupKey backend state file = do
|
lookupKey state backend file = do
|
||||||
k <- readFile (backendFile state backend file)
|
k <- readFile (backendFile state backend file)
|
||||||
return $ chomp k
|
return $ chomp k
|
||||||
where
|
where
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue