Commit 9a6f6842 authored by Andrey Mokhov's avatar Andrey Mokhov
Browse files

Rename redError(_) to putError(_).

parent 327b06e5
......@@ -58,7 +58,7 @@ builderKey builder = case builder of
builderPath :: Builder -> Action String
builderPath builder = do
path <- askConfigWithDefault (builderKey builder) $
redError $ "\nCannot find path to '" ++ (builderKey builder)
putError $ "\nCannot find path to '" ++ (builderKey builder)
++ "' in configuration files."
fixAbsolutePathOnWindows $ if null path then "" else path -<.> exe
......
......@@ -22,7 +22,7 @@ askConfigWithDefault key defaultAction = do
Nothing -> defaultAction
askConfig :: String -> Action String
askConfig key = askConfigWithDefault key . redError
askConfig key = askConfigWithDefault key . putError
$ "Cannot find key '" ++ key ++ "' in configuration files."
-- Oracle for configuration files
......@@ -31,7 +31,7 @@ configOracle = do
let configFile = configPath -/- "system.config"
cfg <- newCache $ \() -> do
unlessM (doesFileExist $ configFile <.> "in") $
redError_ $ "\nConfiguration file '" ++ (configFile <.> "in")
putError_ $ "\nConfiguration file '" ++ (configFile <.> "in")
++ "' is missing; unwilling to proceed."
need [configFile]
putOracle $ "Reading " ++ configFile ++ "..."
......
......@@ -28,9 +28,9 @@ flag f = do
SolarisBrokenShld -> "solaris-broken-shld"
SplitObjectsBroken -> "split-objects-broken"
GhcUnregisterised -> "ghc-unregisterised"
value <- askConfigWithDefault key . redError
value <- askConfigWithDefault key . putError
$ "\nFlag '" ++ key ++ "' not set in configuration files."
unless (value == "YES" || value == "NO") . redError
unless (value == "YES" || value == "NO") . putError
$ "\nFlag '" ++ key ++ "' is set to '" ++ value
++ "' instead of 'YES' or 'NO'."
return $ value == "YES"
......
......@@ -4,7 +4,7 @@ module Util (
replaceIf, replaceEq, replaceSeparators,
unifyPath, (-/-),
chunksOfSize,
putColoured, putOracle, putBuild, redError, redError_,
putColoured, putOracle, putBuild, putError, putError_,
bimap, minusOrd, intersectOrd
) where
......@@ -65,13 +65,13 @@ putBuild :: String -> Action ()
putBuild = putColoured White
-- A more colourful version of error
redError :: String -> Action a
redError msg = do
putError :: String -> Action a
putError msg = do
putColoured Red msg
error $ "GHC build system error: " ++ msg
redError_ :: String -> Action ()
redError_ = void . redError
putError_ :: String -> Action ()
putError_ = void . putError
-- Depending on Data.Bifunctor only for this function seems an overkill
bimap :: (a -> b) -> (c -> d) -> (a, c) -> (b, d)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment