summaryrefslogtreecommitdiff
path: root/Backend/File.hs
diff options
context:
space:
mode:
Diffstat (limited to 'Backend/File.hs')
-rw-r--r--Backend/File.hs10
1 files changed, 9 insertions, 1 deletions
diff --git a/Backend/File.hs b/Backend/File.hs
index a6d42eabd..fb8a05255 100644
--- a/Backend/File.hs
+++ b/Backend/File.hs
@@ -29,6 +29,7 @@ import Types
import UUID
import Messages
import Trust
+import Key
backend :: Backend Annex
backend = Backend {
@@ -38,7 +39,8 @@ backend = Backend {
retrieveKeyFile = copyKeyFile,
removeKey = checkRemoveKey,
hasKey = inAnnex,
- fsckKey = checkKeyOnly
+ fsckKey = checkKeyOnly,
+ upgradableKey = checkUpgradableKey
}
mustProvide :: a
@@ -159,6 +161,12 @@ getNumCopies Nothing = do
where
config = "annex.numcopies"
+{- Ideally, all keys have file size metadata. Old keys may not. -}
+checkUpgradableKey :: Key -> Annex Bool
+checkUpgradableKey key
+ | keySize key == Nothing = return True
+ | otherwise = return False
+
{- This is used to check that numcopies is satisfied for the key on fsck.
- This trusts data in the the location log, and so can check all keys, even
- those with data not present in the current annex.