summaryrefslogtreecommitdiff
path: root/src/Propellor/DotDir.hs
diff options
context:
space:
mode:
authorJoey Hess2018-02-19 12:49:03 -0400
committerJoey Hess2018-02-19 12:49:03 -0400
commit335b5fba4f86929836c9eb59baa8fbd0d311dcf8 (patch)
tree3abaf5e8373717f40af789682414bb0b57a27d38 /src/Propellor/DotDir.hs
parent6f18e665ca8d960a77e437d8edec8f3d14169585 (diff)
output warning message atomically
Before part went to stderr and part to stdout, and the two parts could be reordered in some cases, particularly when concurrent output caused them to be buffered. This commit was sponsored by Trenton Cronholm on Patreon.
Diffstat (limited to 'src/Propellor/DotDir.hs')
-rw-r--r--src/Propellor/DotDir.hs17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/Propellor/DotDir.hs b/src/Propellor/DotDir.hs
index 39c111f6..be5d614d 100644
--- a/src/Propellor/DotDir.hs
+++ b/src/Propellor/DotDir.hs
@@ -454,11 +454,12 @@ updateUpstreamMaster newref = do
-- that does not point at the distrepo, the user must have set that up
-- and is not using the distrepo, so do nothing.
warnoutofdate :: Bool -> IO ()
-warnoutofdate havebranch = do
- warningMessage ("** Your ~/.propellor/ is out of date..")
- let also s = infoMessage [" " ++ s]
- also ("A newer upstream version is available in " ++ distrepo)
- if havebranch
- then also ("To merge it, run: git merge " ++ upstreambranch)
- else also ("To merge it, find the most recent commit in your repository's history that corresponds to an upstream release of propellor, and set refs/remotes/" ++ upstreambranch ++ " to it. Then run propellor again.")
- also ""
+warnoutofdate havebranch = warningMessage $ unlines
+ [ "** Your ~/.propellor/ is out of date.."
+ , indent "A newer upstream version is available in " ++ distrepo
+ , indent $ if havebranch
+ then "To merge it, run: git merge " ++ upstreambranch
+ else "To merge it, find the most recent commit in your repository's history that corresponds to an upstream release of propellor, and set refs/remotes/" ++ upstreambranch ++ " to it. Then run propellor again."
+ ]
+ where
+ indent s = " " ++ s