clean up
This commit is contained in:
parent
cf260d9a15
commit
5b51db7645
1 changed files with 14 additions and 14 deletions
|
@ -15,7 +15,7 @@ import qualified Remote
|
||||||
import qualified Types.Backend
|
import qualified Types.Backend
|
||||||
import qualified Backend
|
import qualified Backend
|
||||||
import Annex.Content
|
import Annex.Content
|
||||||
import Annex.Content.Direct
|
import qualified Annex.Content.Direct as Direct
|
||||||
import Annex.Direct
|
import Annex.Direct
|
||||||
import Annex.Perms
|
import Annex.Perms
|
||||||
import Annex.Link
|
import Annex.Link
|
||||||
|
@ -119,7 +119,7 @@ perform key file backend numcopies = do
|
||||||
-- order matters
|
-- order matters
|
||||||
[ fixLink key file
|
[ fixLink key file
|
||||||
, verifyLocationLog key keystatus file
|
, verifyLocationLog key keystatus file
|
||||||
, verifyDirectMapping key file
|
, verifyAssociatedFiles key file
|
||||||
, verifyDirectMode key file
|
, verifyDirectMode key file
|
||||||
, checkKeySize key keystatus
|
, checkKeySize key keystatus
|
||||||
, checkBackend backend key keystatus (Just file)
|
, checkBackend backend key keystatus (Just file)
|
||||||
|
@ -261,18 +261,18 @@ verifyLocationLog' key desc present u updatestatus = do
|
||||||
showNote "fixing location log"
|
showNote "fixing location log"
|
||||||
updatestatus s
|
updatestatus s
|
||||||
|
|
||||||
{- Ensures the direct mode mapping file is consistent. Each file
|
{- Verifies the associated file records. -}
|
||||||
- it lists for the key should exist, and the specified file should be
|
verifyAssociatedFiles :: Key -> FilePath -> Annex Bool
|
||||||
- included in it.
|
verifyAssociatedFiles key file = do
|
||||||
-}
|
ifM isDirect (godirect, goindirect)
|
||||||
verifyDirectMapping :: Key -> FilePath -> Annex Bool
|
return True
|
||||||
verifyDirectMapping key file = do
|
where
|
||||||
whenM isDirect $ do
|
godirect = do
|
||||||
fs <- addAssociatedFile key file
|
fs <- Direct.addAssociatedFile key file
|
||||||
forM_ fs $ \f ->
|
forM_ fs $ \f ->
|
||||||
unlessM (liftIO $ doesFileExist f) $
|
unlessM (liftIO $ doesFileExist f) $
|
||||||
void $ removeAssociatedFile key f
|
void $ Direct.removeAssociatedFile key f
|
||||||
return True
|
goindirect = return ()
|
||||||
|
|
||||||
{- Ensures that files whose content is available are in direct mode. -}
|
{- Ensures that files whose content is available are in direct mode. -}
|
||||||
verifyDirectMode :: Key -> FilePath -> Annex Bool
|
verifyDirectMode :: Key -> FilePath -> Annex Bool
|
||||||
|
@ -346,9 +346,9 @@ checkBackend backend key keystatus mfile = go =<< isDirect
|
||||||
, checkBackendOr badContent backend key content
|
, checkBackendOr badContent backend key content
|
||||||
)
|
)
|
||||||
go True = maybe nocheck checkdirect mfile
|
go True = maybe nocheck checkdirect mfile
|
||||||
checkdirect file = ifM (goodContent key file)
|
checkdirect file = ifM (Direct.goodContent key file)
|
||||||
( checkBackendOr' (badContentDirect file) backend key file
|
( checkBackendOr' (badContentDirect file) backend key file
|
||||||
(goodContent key file)
|
(Direct.goodContent key file)
|
||||||
, nocheck
|
, nocheck
|
||||||
)
|
)
|
||||||
nocheck = return True
|
nocheck = return True
|
||||||
|
|
Loading…
Add table
Reference in a new issue