From 577ff36472956689ef5bebbefe6770357e2785f4 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 26 Dec 2016 12:07:18 -0400 Subject: Added --build option, which makes propellor simply build itself. --- debian/changelog | 6 ++++++ doc/usage.mdwn | 8 ++++++++ src/Propellor/CmdLine.hs | 3 +++ src/Propellor/Types/CmdLine.hs | 1 + 4 files changed, 18 insertions(+) diff --git a/debian/changelog b/debian/changelog index cb313e2f..765f44c0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +propellor (3.2.4) UNRELEASED; urgency=medium + + * Added --build option, which makes propellor simply build itself. + + -- Joey Hess Mon, 26 Dec 2016 12:03:19 -0400 + propellor (3.2.3) unstable; urgency=medium * Improve extraction of gpg secret key id list, to work with gpg 2.1. diff --git a/doc/usage.mdwn b/doc/usage.mdwn index fc1f8391..3d32538f 100644 --- a/doc/usage.mdwn +++ b/doc/usage.mdwn @@ -55,6 +55,14 @@ and configured in haskell. The hostname given to --spin can be a short name, which is then looked up in the DNS to find the FQDN. +* propellor --build + + Causes propellor to build itself, checking that your config.hs, etc are + valid. + + You do not need to run this as a separate step; propellor automatically + builds itself when using things like --spin. + * propellor --add-key keyid Adds a gpg key, which is used to encrypt the privdata. diff --git a/src/Propellor/CmdLine.hs b/src/Propellor/CmdLine.hs index 448abf62..7840cc33 100644 --- a/src/Propellor/CmdLine.hs +++ b/src/Propellor/CmdLine.hs @@ -26,6 +26,7 @@ usage h = hPutStrLn h $ unlines , " propellor --init" , " propellor" , " propellor --spin targethost [--via relayhost]" + , " propellor --build" , " propellor --add-key keyid" , " propellor --rm-key keyid" , " propellor --list-fields" @@ -53,6 +54,7 @@ processCmdLine = go =<< getArgs <$> mapM hostname (reverse hs) <*> pure (Just r) _ -> Spin <$> mapM hostname ps <*> pure Nothing + go ("--build":[]) = return Build go ("--add-key":k:[]) = return $ AddKey k go ("--rm-key":k:[]) = return $ RmKey k go ("--set":f:c:[]) = withprivfield f c Set @@ -101,6 +103,7 @@ defaultMain hostlist = withConcurrentOutput $ do where go cr (Serialized cmdline) = go cr cmdline go _ Check = return () + go cr Build = buildFirst Nothing cr Build $ return () go _ (Set field context) = setPrivData field context go _ (Unset field context) = unsetPrivData field context go _ (UnsetUnused) = unsetPrivDataUnused hostlist diff --git a/src/Propellor/Types/CmdLine.hs b/src/Propellor/Types/CmdLine.hs index 558c6e8b..d712a456 100644 --- a/src/Propellor/Types/CmdLine.hs +++ b/src/Propellor/Types/CmdLine.hs @@ -28,4 +28,5 @@ data CmdLine | ChrootChain HostName FilePath Bool Bool | GitPush Fd Fd | Check + | Build deriving (Read, Show, Eq) -- cgit v1.2.3