summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Miedema <thomasmiedema@gmail.com>2015-09-04 16:59:44 +0200
committerThomas Miedema <thomasmiedema@gmail.com>2015-09-04 18:21:11 +0200
commit5c372fe50412b8d2606b98ad953d3b0a121f9d9b (patch)
tree7bb2c3358de8008799c5ff5095f2957db4ca34b4
parent64761ce9a899954a12d8e3ae8b400c5ad9648137 (diff)
downloadhaskell-5c372fe50412b8d2606b98ad953d3b0a121f9d9b.tar.gz
ghc-pkg: don't print ignored errors when verbosity=0
Lines like the following are filling up the build logs: binary-0.7.5.0: cannot find any of ["Data/Binary.hi","Data/Binary.p_hi","Data/Binary.dyn_hi"] (ignoring)
-rw-r--r--utils/ghc-pkg/Main.hs16
1 files changed, 9 insertions, 7 deletions
diff --git a/utils/ghc-pkg/Main.hs b/utils/ghc-pkg/Main.hs
index fbd7dae715..4ee0d012f2 100644
--- a/utils/ghc-pkg/Main.hs
+++ b/utils/ghc-pkg/Main.hs
@@ -973,7 +973,7 @@ registerPackage input verbosity my_flags multi_instance
infoLn "done."
-- report any warnings from the parse phase
- _ <- reportValidateErrors [] ws
+ _ <- reportValidateErrors verbosity [] ws
(display (sourcePackageId pkg) ++ ": Warning: ") Nothing
-- validate the expanded pkg, but register the unexpanded
@@ -1465,13 +1465,13 @@ checkConsistency verbosity my_flags = do
True True
if null es
then do when (not simple_output) $ do
- _ <- reportValidateErrors [] ws "" Nothing
+ _ <- reportValidateErrors verbosity [] ws "" Nothing
return ()
return []
else do
when (not simple_output) $ do
reportError ("There are problems in package " ++ display (sourcePackageId p) ++ ":")
- _ <- reportValidateErrors es ws " " Nothing
+ _ <- reportValidateErrors verbosity es ws " " Nothing
return ()
return [p]
@@ -1550,9 +1550,9 @@ liftIO :: IO a -> Validate a
liftIO k = V (k >>= \a -> return (a,[],[]))
-- returns False if we should die
-reportValidateErrors :: [ValidateError] -> [ValidateWarning]
+reportValidateErrors :: Verbosity -> [ValidateError] -> [ValidateWarning]
-> String -> Maybe Force -> IO Bool
-reportValidateErrors es ws prefix mb_force = do
+reportValidateErrors verbosity es ws prefix mb_force = do
mapM_ (warn . (prefix++)) ws
oks <- mapM report es
return (and oks)
@@ -1560,7 +1560,8 @@ reportValidateErrors es ws prefix mb_force = do
report (f,s)
| Just force <- mb_force
= if (force >= f)
- then do reportError (prefix ++ s ++ " (ignoring)")
+ then do when (verbosity >= Normal) $
+ reportError (prefix ++ s ++ " (ignoring)")
return True
else if f < CannotForce
then do reportError (prefix ++ s ++ " (use --force to override)")
@@ -1584,7 +1585,8 @@ validatePackageConfig pkg verbosity db_stack
(_,es,ws) <- runValidate $
checkPackageConfig pkg verbosity db_stack
multi_instance update
- ok <- reportValidateErrors es ws (display (sourcePackageId pkg) ++ ": ") (Just force)
+ ok <- reportValidateErrors verbosity es ws
+ (display (sourcePackageId pkg) ++ ": ") (Just force)
when (not ok) $ exitWith (ExitFailure 1)
checkPackageConfig :: InstalledPackageInfo