annex.numcopies works
This commit is contained in:
parent
aa2f4bd810
commit
508a3b65ed
5 changed files with 71 additions and 11 deletions
15
Backend.hs
15
Backend.hs
|
@ -15,8 +15,9 @@
|
|||
|
||||
module Backend (
|
||||
storeFileKey,
|
||||
removeKey,
|
||||
retrieveKeyFile,
|
||||
removeKey,
|
||||
hasKey,
|
||||
lookupFile
|
||||
) where
|
||||
|
||||
|
@ -77,6 +78,18 @@ retrieveKeyFile backend key dest = (B.retrieveKeyFile backend) key dest
|
|||
removeKey :: Backend -> Key -> Annex Bool
|
||||
removeKey backend key = (B.removeKey backend) key
|
||||
|
||||
{- Checks if any backend has a key. -}
|
||||
hasKey :: Key -> Annex Bool
|
||||
hasKey key = do
|
||||
b <- backendList
|
||||
hasKey' b key
|
||||
hasKey' [] key = return False
|
||||
hasKey' (b:bs) key = do
|
||||
has <- (B.hasKey b) key
|
||||
if (has)
|
||||
then return True
|
||||
else hasKey' bs key
|
||||
|
||||
{- Looks up the key and backend corresponding to an annexed file,
|
||||
- by examining what the file symlinks to. -}
|
||||
lookupFile :: FilePath -> IO (Maybe (Key, Backend))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue