summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJoey Hess2015-01-05 19:43:38 -0400
committerJoey Hess2015-01-05 19:43:38 -0400
commit16031a7c26464485e7c11afdec7d0b80dfe2f5bf (patch)
treead09df51c6daa9deb07e80a37731d9ff811e5551 /src
parent0235e88ea22c092b43aa0cf709e8c63d8556700a (diff)
parentbd7c118caea362005c7dbdea5d6fd3da1d98fe9a (diff)
Merge branch 'joeyconfig'
Diffstat (limited to 'src')
-rw-r--r--src/Propellor/Protocol.hs12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/Propellor/Protocol.hs b/src/Propellor/Protocol.hs
index 95a671bc..b6d38d06 100644
--- a/src/Propellor/Protocol.hs
+++ b/src/Propellor/Protocol.hs
@@ -41,6 +41,11 @@ fromMarked marker s
sendMarked :: Handle -> Marker -> String -> IO ()
sendMarked h marker s = do
+ debug ["sent marked", marker]
+ sendMarked' h marker s
+
+sendMarked' :: Handle -> Marker -> String -> IO ()
+sendMarked' h marker s = do
-- Prefix string with newline because sometimes a
-- incomplete line has been output, and the marker needs to
-- come at the start of a line.
@@ -56,9 +61,12 @@ getMarked h marker = go =<< catchMaybeIO (hGetLine h)
unless (null l) $
hPutStrLn stderr l
getMarked h marker
- Just v -> return (Just v)
+ Just v -> do
+ debug ["received marked", marker]
+ return (Just v)
req :: Stage -> Marker -> (String -> IO ()) -> IO ()
req stage marker a = do
- sendMarked stdout statusMarker (show stage)
+ debug ["requested marked", marker]
+ sendMarked' stdout statusMarker (show stage)
maybe noop a =<< getMarked stdin marker