From 4bbab3db9856b1c3fb4403add8b391179baf29c6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 6 Mar 2016 18:15:00 -0400 Subject: stop using --continue SimpleRun for spin When spinning a remote host, we do want to rebuild propellor on it, and this use of --continue that did a rebuild was different from all the other uses of --continue that avoided a rebuild. This fixes a build loop involving that special case. When --continue SimpleRun ran a rebuild, it re-execed propellor with --continue SimpleRun, and so would rebuild again, and re-exec again if the binary kept changing. Backwards compatability should be ok; old versions of propellor, when run with --serialized SimpleRun by the new version, do a buildFirst, followed by another (redundant) buildFirst, and then run. The one redundant buildFirst is not a problem in the upgrade scenario. (Unfortunately, I can't rename SimpleRun to something nicer despite only spin using it; backwards compatability does prevent that.) --- src/Propellor/CmdLine.hs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/Propellor/CmdLine.hs') diff --git a/src/Propellor/CmdLine.hs b/src/Propellor/CmdLine.hs index 5e6769c9..f708c1d9 100644 --- a/src/Propellor/CmdLine.hs +++ b/src/Propellor/CmdLine.hs @@ -125,12 +125,8 @@ defaultMain hostlist = withConcurrentOutput $ do ( runhost hn , go cr (Spin [hn] Nothing) ) - 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 a build first - forceConsole >> fetchFirst (buildFirst cr cmdline (runhost hn)) + go cr cmdline@(SimpleRun hn) = forceConsole >> + fetchFirst (buildFirst cr cmdline (runhost hn)) -- When continuing after a rebuild, don't want to rebuild again. go _ (Continue cmdline) = go NoRebuild cmdline -- cgit v1.2.3