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/Spin.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/Propellor/Spin.hs') diff --git a/src/Propellor/Spin.hs b/src/Propellor/Spin.hs index 6246b04f..495ebaf4 100644 --- a/src/Propellor/Spin.hs +++ b/src/Propellor/Spin.hs @@ -112,9 +112,10 @@ spin' mprivdata relay target hst = do ] runcmd = "cd " ++ localdir ++ " && ./propellor " ++ cmd - cmd = if viarelay - then "--serialized " ++ shellEscape (show (Spin [target] (Just target))) - else "--continue " ++ shellEscape (show (SimpleRun target)) + cmd = "--serialized " ++ shellEscape (show cmdline) + cmdline + | viarelay = Spin [target] (Just target) + | otherwise = SimpleRun target getprivdata = case mprivdata of Nothing -- cgit v1.2.3