Repository : ssh://darcs.haskell.org//srv/darcs/packages/Cabal

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/cdac57db6801683b05c2b9ee688805e218cef91a

>---------------------------------------------------------------

commit cdac57db6801683b05c2b9ee688805e218cef91a
Author: Lennart Kolmodin <[email protected]>
Date:   Thu Feb 21 21:32:01 2008 +0000

    Make the qa check return an exit code reporting the status

>---------------------------------------------------------------

 cabal-install/Hackage/Check.hs |    3 ++-
 cabal-install/Main.hs          |    5 ++++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/cabal-install/Hackage/Check.hs b/cabal-install/Hackage/Check.hs
index 0603c4c..f2ba43c 100644
--- a/cabal-install/Hackage/Check.hs
+++ b/cabal-install/Hackage/Check.hs
@@ -23,7 +23,7 @@ import Distribution.PackageDescription.Configuration ( 
flattenPackageDescription
 import Distribution.Verbosity ( Verbosity )
 import Distribution.Simple.Utils ( defaultPackageDesc )
 
-check :: Verbosity -> IO ()
+check :: Verbosity -> IO Bool
 check verbosity = do
     pdfile <- defaultPackageDesc verbosity
     ppd <- readPackageDescription verbosity pdfile
@@ -78,3 +78,4 @@ check verbosity = do
     when (null packageChecks) $ do
         putStrLn "No errors or warnings could be found in the package."
 
+    return (null packageChecks)
diff --git a/cabal-install/Main.hs b/cabal-install/Main.hs
index 6d222a2..28b83fb 100644
--- a/cabal-install/Main.hs
+++ b/cabal-install/Main.hs
@@ -202,4 +202,7 @@ checkAction :: Flag Verbosity -> [String] -> IO ()
 checkAction verbosityFlag extraArgs = do
   unless (null extraArgs) $ do
     die $ "'check' doesn't take any extra arguments: " ++ unwords extraArgs
-  Check.check (fromFlag verbosityFlag)
+  allOk <- Check.check (fromFlag verbosityFlag)
+  if allOk
+    then exitWith ExitSuccess
+    else exitWith (ExitFailure 1)



_______________________________________________
Cvs-libraries mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-libraries

Reply via email to