diff options
author | Joey Hess <joey@kitenet.net> | 2010-10-31 14:32:18 -0400 |
---|---|---|
committer | Joey Hess <joey@kitenet.net> | 2010-10-31 14:32:18 -0400 |
commit | 1576c48c80e4806b6021ec66f0dc645cf0a83486 (patch) | |
tree | d22b6f821f8367b678663fe49616cb7047ce60b1 | |
parent | dc12ce762e521a5db052346eb67590ca62e4f2f6 (diff) |
more Wall cleaning
-rw-r--r-- | Annex.hs | 5 | ||||
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | git-annex.hs | 5 |
3 files changed, 8 insertions, 4 deletions
@@ -39,15 +39,16 @@ new gitrepo allbackends = do Internals.flags = M.empty, Internals.repoqueue = GitQueue.empty } - (_,s') <- Annex.run s (prep gitrepo) + (_,s') <- Annex.run s prep return s' where - prep gitrepo = do + prep = do -- read git config and update state gitrepo' <- liftIO $ Git.configRead gitrepo Annex.gitRepoChange gitrepo' {- performs an action in the Annex monad -} +run :: AnnexState -> StateT AnnexState IO a -> IO (a, AnnexState) run state action = runStateT (action) state {- Returns the git repository being acted on -} @@ -2,7 +2,7 @@ all: git-annex docs git-annex: mkdir -p build - ghc -odir build -hidir build --make git-annex + ghc -Wall -odir build -hidir build --make git-annex install: install -d $(DESTDIR)/usr/bin diff --git a/git-annex.hs b/git-annex.hs index 5011fade2..e9e0d6f02 100644 --- a/git-annex.hs +++ b/git-annex.hs @@ -17,6 +17,7 @@ import Commands import qualified GitRepo as Git import BackendList +main :: IO () main = do args <- getArgs gitrepo <- Git.repoFromCwd @@ -35,6 +36,7 @@ main = do -} tryRun :: AnnexState -> [Annex Bool] -> IO () tryRun state actions = tryRun' state 0 actions +tryRun' :: AnnexState -> Integer -> [Annex Bool] -> IO () tryRun' state errnum (a:as) = do result <- try $ Annex.run state a case (result) of @@ -43,8 +45,9 @@ tryRun' state errnum (a:as) = do tryRun' state (errnum + 1) as Right (True,state') -> tryRun' state' errnum as Right (False,state') -> tryRun' state' (errnum + 1) as -tryRun' state errnum [] = +tryRun' _ errnum [] = when (errnum > 0) $ error $ (show errnum) ++ " failed" {- Exception pretty-printing. -} +showErr :: (Show a) => a -> IO () showErr e = hPutStrLn stderr $ "git-annex: " ++ (show e) |