Commit 302b0dce authored by bardur.arantsson's avatar bardur.arantsson Committed by tibbe
Browse files

Print full build log instead of only the last 10 lines

(cherry picked from commit f00dc68e)
parent ffd67e5e
......@@ -1051,8 +1051,8 @@ executeInstallPlan verbosity jobCtl useLogFile plan0 installPkg =
-- now cannot build, we mark as failing due to 'DependentFailed'
-- which kind of means it was not their fault.
-- Print last 10 lines of the build log if something went wrong, and
-- 'Installed $PKGID' otherwise.
-- Print build log if something went wrong, and 'Installed $PKGID'
-- otherwise.
printBuildResult :: PackageId -> BuildResult -> IO ()
printBuildResult pkgid buildResult = case buildResult of
(Right _) -> notice verbosity $ "Installed " ++ display pkgid
......@@ -1063,17 +1063,11 @@ executeInstallPlan verbosity jobCtl useLogFile plan0 installPkg =
Nothing -> return ()
Just (mkLogFileName, _) -> do
let logName = mkLogFileName pkgid
n = 10
putStr $ "Last " ++ (show n)
++ " lines of the build log ( " ++ logName ++ " ):\n"
printLastNLines logName n
printLastNLines :: FilePath -> Int -> IO ()
printLastNLines path n = do
lns <- fmap lines $ readFile path
let len = length lns
let toDrop = if (len > n && n > 0) then (len - n) else 0
mapM_ putStrLn (drop toDrop lns)
putStr $ "Build log ( " ++ logName ++ " ):\n"
printFile logName
printFile :: FilePath -> IO ()
printFile path = readFile path >>= putStr
-- | Call an installer for an 'SourcePackage' but override the configure
-- flags with the ones given by the 'ReadyPackage'. In particular the
......
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