migrate: Support migrating v1 SHA keys to v2 SHA keys with size information that can be used for free space checking.
This commit is contained in:
parent
ad08273ac5
commit
6246b807f7
9 changed files with 54 additions and 10 deletions
|
@ -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))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue