[commit: ghc] wip/nfs-locking: Don't separate build commands with an empty line.\n\nThis allows to fit more commands on screen. (412009d)

git at git.haskell.org git at git.haskell.org
Fri Oct 27 00:25:39 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/nfs-locking
Link       : http://ghc.haskell.org/trac/ghc/changeset/412009d52e693f3f67b86a71de4e7f359cd3b2a8/ghc

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

commit 412009d52e693f3f67b86a71de4e7f359cd3b2a8
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Tue Jan 5 23:21:54 2016 +0000

    Don't separate build commands with an empty line.\n\nThis allows to fit more commands on screen.


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

412009d52e693f3f67b86a71de4e7f359cd3b2a8
 src/Base.hs          |  2 +-
 src/Rules/Actions.hs | 10 +++++-----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/Base.hs b/src/Base.hs
index 69904c4..36f2eb9 100644
--- a/src/Base.hs
+++ b/src/Base.hs
@@ -174,7 +174,7 @@ putError msg = do
 
 -- | Render the given set of lines in a nice box of ASCII
 renderBox :: [String] -> String
-renderBox ls = concatMap ('\n' :) (boxTop : map renderLine ls ++ [boxBot])
+renderBox ls = tail $ concatMap ('\n' :) (boxTop : map renderLine ls ++ [boxBot])
   where
     -- Minimum total width of the box in characters
     minimumBoxWidth = 32
diff --git a/src/Rules/Actions.hs b/src/Rules/Actions.hs
index d567747..6f116b5 100644
--- a/src/Rules/Actions.hs
+++ b/src/Rules/Actions.hs
@@ -71,7 +71,7 @@ copyFile source target = do
 
 createDirectory :: FilePath -> Action ()
 createDirectory dir = do
-    putBuild $ "\n| Create directory " ++ dir
+    putBuild $ "| Create directory " ++ dir
     liftIO $ IO.createDirectoryIfMissing True dir
 
 -- Note, the source directory is untracked
@@ -85,7 +85,7 @@ moveDirectory source target = do
 -- Transform a given file by applying a function to its contents
 fixFile :: FilePath -> (String -> String) -> Action ()
 fixFile file f = do
-    putBuild $ "\n| Fix " ++ file
+    putBuild $ "| Fix " ++ file
     old <- liftIO $ readFile file
     let new = f old
     length new `seq` liftIO $ writeFile file new
@@ -93,14 +93,14 @@ fixFile file f = do
 runConfigure :: FilePath -> [CmdOption] -> [String] -> Action ()
 runConfigure dir opts args = do
     need [dir -/- "configure"]
-    putBuild $ "\n| Run configure in " ++ dir ++ "..."
+    putBuild $ "| Run configure in " ++ dir ++ "..."
     quietly $ cmd Shell (EchoStdout False) [Cwd dir] "bash configure" opts args
 
 runMake :: FilePath -> [String] -> Action ()
 runMake dir args = do
     need [dir -/- "Makefile"]
     let note = if null args then "" else " (" ++ intercalate "," args ++ ")"
-    putBuild $ "\n| Run make" ++ note ++ " in " ++ dir ++ "..."
+    putBuild $ "| Run make" ++ note ++ " in " ++ dir ++ "..."
     quietly $ cmd Shell (EchoStdout False) "make" ["-C", dir, "MAKEFLAGS="] args
 
 runBuilder :: Builder -> [String] -> Action ()
@@ -108,7 +108,7 @@ runBuilder builder args = do
     needBuilder laxDependencies builder
     path <- builderPath builder
     let note = if null args then "" else " (" ++ intercalate "," args ++ ")"
-    putBuild $ "\n| Run " ++ show builder ++ note
+    putBuild $ "| Run " ++ show builder ++ note
     quietly $ cmd [path] args
 
 -- Print out key information about the command being executed



More information about the ghc-commits mailing list