summaryrefslogtreecommitdiff
path: root/Propellor/CmdLine.hs
diff options
context:
space:
mode:
authorJoey Hess2014-03-31 15:43:24 -0400
committerJoey Hess2014-03-31 15:43:24 -0400
commit94d09dfd64eb027e2afe2715c3dee5196d807145 (patch)
treeb3ed9ae3858d3dc3f0cb4849c725fa0f0656b366 /Propellor/CmdLine.hs
parent9172b796122bf9558873ad4a2356d4f9d817d3e2 (diff)
propellor spin
Diffstat (limited to 'Propellor/CmdLine.hs')
-rw-r--r--Propellor/CmdLine.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/Propellor/CmdLine.hs b/Propellor/CmdLine.hs
index 7b82d281..e57d70b7 100644
--- a/Propellor/CmdLine.hs
+++ b/Propellor/CmdLine.hs
@@ -164,12 +164,13 @@ privDataMarker :: String
privDataMarker = "PRIVDATA "
toMarked :: Marker -> String -> String
-toMarked marker = unlines . map (marker ++) . lines
+toMarked marker = intercalate "\n" . map (marker ++) . lines
fromMarked :: Marker -> Marked -> Maybe String
fromMarked marker s
| null matches = Nothing
- | otherwise = Just $ unlines $ map (drop len) matches
+ | otherwise = Just $ intercalate "\n" $
+ map (drop len) matches
where
len = length marker
matches = filter (marker `isPrefixOf`) $ lines s
@@ -184,7 +185,7 @@ boot props = do
makePrivDataDir
maybe noop (writeFileProtected privDataLocal) $
fromMarked privDataMarker reply
- case eitherToMaybe . B64.decode . BL.pack . s2w8 . takeWhile (/= '\n') =<< fromMarked keyringMarker reply of
+ case eitherToMaybe . B64.decode . BL.pack . s2w8 =<< fromMarked keyringMarker reply of
Nothing -> noop
Just d -> do
writeFileProtected keyring ""