diff options
author | Joey Hess <joey@kitenet.net> | 2011-03-23 17:57:10 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2011-03-23 17:57:10 -0400 |
commit | 6246b807f7df32877a87d906cfbe1ae26c51dd8e (patch) | |
tree | 00c38d74c2b4591ab0a68a807bb70c6044cde3f4 /Backend.hs | |
parent | ad08273ac5118f1faac539b53f1fa63908dc5656 (diff) |
migrate: Support migrating v1 SHA keys to v2 SHA keys with size information that can be used for free space checking.
Diffstat (limited to 'Backend.hs')
-rw-r--r-- | Backend.hs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Backend.hs b/Backend.hs index 0ee56d262..4b0095214 100644 --- a/Backend.hs +++ b/Backend.hs @@ -24,6 +24,7 @@ module Backend ( removeKey, hasKey, fsckKey, + upgradableKey, lookupFile, chooseBackends, keyBackend, @@ -130,6 +131,10 @@ fsckKey backend key file numcopies = do backend_ok <-(B.fsckKey backend) key file numcopies return $ size_ok && backend_ok +{- Checks if a key is upgradable to a newer representation. -} +upgradableKey :: Backend Annex -> Key -> Annex Bool +upgradableKey backend key = (B.upgradableKey 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 Annex)) |