diff options
| author | Joey Hess <joeyh@joeyh.name> | 2016-03-08 01:38:28 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2016-03-08 01:38:28 -0400 |
| commit | a6862da9ce7a479d34f58637e79289aa428e69f3 (patch) | |
| tree | a1ad08bcb92d098a16baef2fb36874bbb56ef460 /src/Propellor/Spin.hs | |
| parent | 2415e5faa684c58f01264b53b28503aee226db1f (diff) | |
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.
Diffstat (limited to 'src/Propellor/Spin.hs')
| -rw-r--r-- | src/Propellor/Spin.hs | 15 |
1 files changed, 8 insertions, 7 deletions
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 |
