summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess2016-03-02 15:07:25 -0400
committerJoey Hess2016-03-02 15:12:10 -0400
commitd514079f83ee6c60fb1cd0613dbe5145eff4d403 (patch)
tree18d267ea03b7526e9a165626299d4b2b202951d7
parentc7888940cabf4026803bab0319721d032d67b911 (diff)
always buildFirst when --spin does --continue SimpleRun
There may not be changes from the origin repo, so fetchFirst wouldn't build, but changes are pushed by spin, so it always needs to build.
-rw-r--r--src/Propellor/CmdLine.hs13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/Propellor/CmdLine.hs b/src/Propellor/CmdLine.hs
index a5ea1f1c..a0ae9cb5 100644
--- a/src/Propellor/CmdLine.hs
+++ b/src/Propellor/CmdLine.hs
@@ -122,22 +122,23 @@ defaultMain hostlist = withConcurrentOutput $ do
forM_ hs $ \hn -> withhost hn $ spin mrelay hn
go cr (Run hn) = fetchFirst $
ifM ((==) 0 <$> getRealUserID)
- ( onlyprocess $ withhost hn mainProperties
+ ( runhost hn
, go cr (Spin [hn] Nothing)
)
- go cr (SimpleRun hn) = go cr (Run hn)
- go cr (Continue cmdline@(SimpleRun _)) =
+ go _ (SimpleRun hn) = runhost hn
+ go cr (Continue cmdline@(SimpleRun hn)) =
-- --continue SimpleRun is used by --spin,
-- and unlike all other uses of --continue, this legacy one
- -- wants an update first (to get any changes from the
- -- central git repo)
- forceConsole >> updateFirst cr cmdline (go NoRebuild cmdline)
+ -- wants a build first
+ forceConsole >> fetchFirst (buildFirst cr cmdline (runhost hn))
-- When continuing after a rebuild, don't want to rebuild again.
go _ (Continue cmdline) = go NoRebuild cmdline
withhost :: HostName -> (Host -> IO ()) -> IO ()
withhost hn a = maybe (unknownhost hn hostlist) a (findHost hostlist hn)
+ runhost hn = onlyprocess $ withhost hn mainProperties
+
onlyprocess = onlyProcess (localdir </> ".lock")
unknownhost :: HostName -> [Host] -> IO a