From a6862da9ce7a479d34f58637e79289aa428e69f3 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 8 Mar 2016 01:38:28 -0400 Subject: fix reversion in bootstrap spin of system with no declared OS The freebsd changes caused a bootstrap of a system with no declared OS to not work, where before it was assumed to be some debian-like system where apt can be used. Brought back this assumption. --- src/Propellor/Spin.hs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src/Propellor/Spin.hs') diff --git a/src/Propellor/Spin.hs b/src/Propellor/Spin.hs index 2c57f57d..5f103b8a 100644 --- a/src/Propellor/Spin.hs +++ b/src/Propellor/Spin.hs @@ -79,12 +79,10 @@ spin' mprivdata relay target hst = do Just r -> pure r Nothing -> getSshTarget target hst - let (InfoVal o) = (getInfo $ hostInfo hst) :: InfoVal System - -- Install, or update the remote propellor. updateServer target relay hst - (proc "ssh" $ cacheparams ++ [sshtarget, shellWrap (probecmd o)]) - (proc "ssh" $ cacheparams ++ [sshtarget, shellWrap (updatecmd (Just o))]) + (proc "ssh" $ cacheparams ++ [sshtarget, shellWrap probecmd]) + (proc "ssh" $ cacheparams ++ [sshtarget, shellWrap updatecmd]) =<< getprivdata -- And now we can run it. @@ -92,21 +90,24 @@ spin' mprivdata relay target hst = do error "remote propellor failed" where hn = fromMaybe target relay + sys = case getInfo (hostInfo hst) of + InfoVal o -> Just o + NoInfoVal -> Nothing relaying = relay == Just target viarelay = isJust relay && not relaying - probecmd sys = intercalate " ; " + probecmd = intercalate " ; " ["if [ ! -d " ++ localdir ++ "/.git ]" , "then (" ++ intercalate " && " [ installGitCommand sys , "echo " ++ toMarked statusMarker (show NeedGitClone) ] ++ ") || echo " ++ toMarked statusMarker (show NeedPrecompiled) - , "else " ++ (updatecmd (Just sys)) + , "else " ++ updatecmd , "fi" ] - updatecmd sys = intercalate " && " + updatecmd = intercalate " && " [ "cd " ++ localdir , bootstrapPropellorCommand sys , if viarelay -- cgit v1.2.3