Commit 221e2f59 authored by Valentin Reis's avatar Valentin Reis
Browse files

verbosity management.

parent 23781aae
Pipeline #5480 passed with stage
in 27 seconds
......@@ -227,8 +227,8 @@ cleanSocket = sudoRemoveFile printWarning "socket"
setupSystem :: ArgsCommon -> Shell ()
setupSystem sa = do
printInfo "Setting the nix-build environment up."
printInfo "Cleaning sockets."
doVerbose $ printInfo "Setting the nix-build environment up."
doVerbose $ printInfo "Cleaning sockets."
Prelude.mapM_
cleanSocket
[ "/tmp/nrm-downstream-in"
......@@ -236,16 +236,16 @@ setupSystem sa = do
, "/tmp/nrm-upstream-in"
, "/tmp/nrm-upstream-event"
]
printInfo "Setting up a cache directory:"
doVerbose $ printInfo "Setting up a cache directory:"
cachedir <- single
$ inproc "mktemp" ["-d", "/tmp/deletable-nix-cache-XXXX"] empty
export "XDG_CACHE_HOME" $ lineToText cachedir
printInfo $ lineToText cachedir <> " exported to XDG_CACHE_HOME"
printInfo "running nix-build for the containers attribute."
printCommand $ "nix-build " <> pack (unwords (nixArguments "containers" sa))
doVerbose $ printInfo $ lineToText cachedir <> " exported to XDG_CACHE_HOME"
doVerbose $ printInfo "running nix-build for the containers attribute."
doVerbose $ printCommand $ "nix-build " <> pack (unwords (nixArguments "containers" sa))
nodeos_config <- single
$ inproc "nix-build" (fmap pack (nixArguments "containers" sa)) empty
printInfo "Checking filesystem attributes on /tmp"
doVerbose $ printInfo "Checking filesystem attributes on /tmp"
checkFsAttributes "/tmp"
vshell "sudo rm -rf /tmp/argo_nodeos_config" empty
vshell
......@@ -262,7 +262,9 @@ setupSystem sa = do
ExitFailure n -> die ("Setting suid bit failed with exit code " <> repr n)
vshell "sudo /tmp/argo_nodeos_config --clean_config=kill_content:true" empty
void $ printInfo "Done setting the environment for nix-build up."
where vshell = verboseShell (verbosity sa == Verbose)
where vshell = verboseShell verbose
verbose = verbosity sa == Verbose
doVerbose = when verbose
nixArguments :: String -> ArgsCommon -> [String]
nixArguments target ArgsCommon {..} =
......
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