summaryrefslogtreecommitdiff
path: root/src/Propellor/CmdLine.hs
diff options
context:
space:
mode:
authorJoey Hess2015-04-02 10:20:44 -0400
committerJoey Hess2015-04-02 10:20:44 -0400
commit86783dc52d048418439019067a0a1afccd4829d1 (patch)
tree392e55d1b1abecf0dab5e4b0ecec3a9359d0f6e0 /src/Propellor/CmdLine.hs
parent015b249c6672527dce31a61610358ccbb46f3b46 (diff)
Make propellor resistent to changes to shared libraries, such as libffi
* Make propellor resistent to changes to shared libraries, such as libffi, which might render the propellor binary unable to run. This is dealt with by checking the binary both when running propellor on a remote host, and by Cron.runPropellor. If the binary doesn't work, it will be rebuilt. * Note that since a new switch had to be added to allow testing the binary, upgrading to this version will cause a rebuild from scratch of propellor.
Diffstat (limited to 'src/Propellor/CmdLine.hs')
-rw-r--r--src/Propellor/CmdLine.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Propellor/CmdLine.hs b/src/Propellor/CmdLine.hs
index 9d7d0d95..1298daf2 100644
--- a/src/Propellor/CmdLine.hs
+++ b/src/Propellor/CmdLine.hs
@@ -33,6 +33,7 @@ usage h = hPutStrLn h $ unlines
, " propellor --list-fields"
, " propellor --merge"
, " propellor --build"
+ , " propellor --check"
]
usageError :: [String] -> IO a
@@ -43,6 +44,7 @@ usageError ps = do
processCmdLine :: IO CmdLine
processCmdLine = go =<< getArgs
where
+ go ("--check":_) = return Check
go ("--spin":ps) = case reverse ps of
(r:"--via":hs) -> Spin
<$> mapM hostname (reverse hs)
@@ -91,6 +93,7 @@ defaultMain hostlist = do
where
go _ (Serialized cmdline) = go True cmdline
go _ (Continue cmdline) = go False cmdline
+ go _ Check = return ()
go _ (Set field context) = setPrivData field context
go _ (Dump field context) = dumpPrivData field context
go _ (Edit field context) = editPrivData field context