summaryrefslogtreecommitdiff
path: root/src/Propellor/CmdLine.hs
diff options
context:
space:
mode:
authorJoey Hess2014-07-09 22:12:23 -0400
committerJoey Hess2014-07-09 22:12:23 -0400
commit0c5e16184f795a329ee9592f6c7bf94ec4312d87 (patch)
treeac7c846019ac37018cd0446a760b791ab42367ae /src/Propellor/CmdLine.hs
parent40f64416def7d2a522cc7e3a111593eea8e57134 (diff)
parent54d2888a9616cf5005422b34446797f0357b0098 (diff)
Merge branch 'joeyconfig'
Diffstat (limited to 'src/Propellor/CmdLine.hs')
-rw-r--r--src/Propellor/CmdLine.hs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/Propellor/CmdLine.hs b/src/Propellor/CmdLine.hs
index 448e70d2..7b39cd24 100644
--- a/src/Propellor/CmdLine.hs
+++ b/src/Propellor/CmdLine.hs
@@ -92,7 +92,7 @@ defaultMain hostlist = do
go False (Boot hn) = onlyProcess $ withhost hn boot
withhost :: HostName -> (Host -> IO ()) -> IO ()
- withhost hn a = maybe (unknownhost hn) a (findHost hostlist hn)
+ withhost hn a = maybe (unknownhost hn hostlist) a (findHost hostlist hn)
onlyProcess :: IO a -> IO a
onlyProcess a = bracket lock unlock (const a)
@@ -106,11 +106,12 @@ onlyProcess a = bracket lock unlock (const a)
alreadyrunning = error "Propellor is already running on this host!"
lockfile = localdir </> ".lock"
-unknownhost :: HostName -> IO a
-unknownhost h = errorMessage $ unlines
+unknownhost :: HostName -> [Host] -> IO a
+unknownhost h hosts = errorMessage $ unlines
[ "Propellor does not know about host: " ++ h
, "(Perhaps you should specify the real hostname on the command line?)"
, "(Or, edit propellor's config.hs to configure this host)"
+ , "Known hosts: " ++ unwords (map hostName hosts)
]
buildFirst :: CmdLine -> IO () -> IO ()
@@ -209,7 +210,8 @@ spin hn hst = do
bootstrapcmd = shellWrap $ intercalate " ; "
[ "if [ ! -d " ++ localdir ++ " ]"
, "then " ++ intercalate " && "
- [ "apt-get --no-install-recommends --no-upgrade -y install git make"
+ [ "apt-get update"
+ , "apt-get --no-install-recommends --no-upgrade -y install git make"
, "echo " ++ toMarked statusMarker (show NeedGitClone)
]
, "else " ++ intercalate " && "