diff options
author | 2010-11-06 17:06:19 -0400 | |
---|---|---|
committer | 2010-11-06 17:06:59 -0400 | |
commit | 016b6a59e7187ead0ed630699c85d0fec729a30d (patch) | |
tree | 15c2fc2a681bde535758948b9f9460b5a84b21d6 /Command/Fsck.hs | |
parent | 6b80356f6de05efef1f14fd2af9835cf5abe69a0 (diff) |
add fsck subcommand (stub)
Diffstat (limited to 'Command/Fsck.hs')
-rw-r--r-- | Command/Fsck.hs | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/Command/Fsck.hs b/Command/Fsck.hs new file mode 100644 index 000000000..bd5a9ad7f --- /dev/null +++ b/Command/Fsck.hs @@ -0,0 +1,39 @@ +{- git-annex command + - + - Copyright 2010 Joey Hess <joey@kitenet.net> + - + - Licensed under the GNU GPL version 3 or higher. + -} + +module Command.Fsck where + +import Control.Monad.State (liftIO) +import System.Posix.Files +import System.Directory + +import Command +import qualified Annex +import Types +import Utility +import Core + +{- Checks the whole annex for problems. -} +start :: SubCmdStart +start = do + showStart "fsck" "" + return $ Just perform + +perform :: SubCmdPerform +perform = do + ok <- checkUnused + if (ok) + then return $ Just $ return True + else do + showLongNote "Possible problems detected." + return Nothing + +checkUnused :: Annex Bool +checkUnused = do + showNote "checking for unused data..." + -- TODO + return False |