propellor spin

This commit is contained in:
Joey Hess 2014-03-31 14:22:48 -04:00
parent 53ece3a155
commit 5c814d3780
Failed to extract signature
1 changed files with 7 additions and 3 deletions

View File

@ -100,9 +100,13 @@ spin host = do
, "./propellor --boot " ++ host
]
getstatus :: Handle -> IO BootStrapStatus
getstatus h = maybe (getstatus h) return
. (readish <=< fromMarked statusMarker)
=<< hGetLine h
getstatus h = do
l <- hGetLine h
case readish =<< fromMarked statusMarker l of
Nothing -> do
putStrLn l
getstatus h
Just status -> return status
data BootStrapStatus = HaveKeyRing | NeedKeyRing
deriving (Read, Show, Eq)