aboutsummaryrefslogtreecommitdiff
path: root/Backend.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2010-11-13 14:59:27 -0400
committerGravatar Joey Hess <joey@kitenet.net>2010-11-13 14:59:27 -0400
commit5fa25a812a8a03af9f6a5fdb3d06eb4d89ee06f5 (patch)
tree467341e52d23660eee3dc05c9935c961801374e5 /Backend.hs
parentd4d65a3c923de1eece50463145e875326bfe57e9 (diff)
fsck improvements
* fsck: Check if annex.numcopies is satisfied. * fsck: Verify the sha1 of files when the SHA1 backend is used. * fsck: Verify the size of files when the WORM backend is used. * fsck: Allow specifying individual files to fsk if fscking everything is not desired. * fsck: Fix bug, introduced in 0.04, in detection of unused data.
Diffstat (limited to 'Backend.hs')
-rw-r--r--Backend.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/Backend.hs b/Backend.hs
index 43b450736..14af56bbf 100644
--- a/Backend.hs
+++ b/Backend.hs
@@ -23,6 +23,7 @@ module Backend (
retrieveKeyFile,
removeKey,
hasKey,
+ fsckKey,
lookupFile,
chooseBackends
) where
@@ -105,7 +106,7 @@ retrieveKeyFile backend key dest = (Internals.retrieveKeyFile backend) key dest
{- Removes a key from a backend. -}
removeKey :: Backend -> Key -> Annex Bool
-removeKey backend key = (Internals.removeKey backend) key
+removeKey backend key = (Internals.removeKey backend) key
{- Checks if a key is present in its backend. -}
hasKey :: Key -> Annex Bool
@@ -113,6 +114,10 @@ hasKey key = do
bs <- Annex.supportedBackends
(Internals.hasKey (lookupBackendName bs $ backendName key)) key
+{- Checks a key's backend for problems. -}
+fsckKey :: Backend -> Key -> Annex Bool
+fsckKey backend key = (Internals.fsckKey backend) key
+
{- Looks up the key and backend corresponding to an annexed file,
- by examining what the file symlinks to. -}
lookupFile :: FilePath -> Annex (Maybe (Key, Backend))