From 593043515fecb28d4a55d51515eea9fbb69bc05e Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 7 Jul 2014 01:57:59 -0400 Subject: propellor spin --- src/Propellor/CmdLine.hs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/Propellor/CmdLine.hs') diff --git a/src/Propellor/CmdLine.hs b/src/Propellor/CmdLine.hs index 448e70d2..bc5421e7 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 () -- cgit v1.3-2-g0d8e From 75ba4c5cccae7868dfa8caee0bd380022d23b9ca Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 7 Jul 2014 02:00:04 -0400 Subject: propellor spin --- src/Propellor/CmdLine.hs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/Propellor/CmdLine.hs') diff --git a/src/Propellor/CmdLine.hs b/src/Propellor/CmdLine.hs index bc5421e7..2a1d5e03 100644 --- a/src/Propellor/CmdLine.hs +++ b/src/Propellor/CmdLine.hs @@ -122,7 +122,9 @@ buildFirst cmdline next = do newtime <- getmtime if newtime == oldtime then next - else void $ boolSystem "./propellor" [Param "--continue", Param (show cmdline)] + else do + print ["./propellor"] + void $ boolSystem "./propellor" [Param "--continue", Param (show cmdline)] , errorMessage "Propellor build failed!" ) where -- cgit v1.3-2-g0d8e From bc8b7f2173835cb507d81c084fa804bdb3761bdd Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 7 Jul 2014 02:01:57 -0400 Subject: propellor spin --- src/Propellor/CmdLine.hs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/Propellor/CmdLine.hs') diff --git a/src/Propellor/CmdLine.hs b/src/Propellor/CmdLine.hs index 2a1d5e03..bc5421e7 100644 --- a/src/Propellor/CmdLine.hs +++ b/src/Propellor/CmdLine.hs @@ -122,9 +122,7 @@ buildFirst cmdline next = do newtime <- getmtime if newtime == oldtime then next - else do - print ["./propellor"] - void $ boolSystem "./propellor" [Param "--continue", Param (show cmdline)] + else void $ boolSystem "./propellor" [Param "--continue", Param (show cmdline)] , errorMessage "Propellor build failed!" ) where -- cgit v1.3-2-g0d8e From 8f46b7ab683a36eebb3fd99566c389bd45a47676 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 7 Jul 2014 02:04:21 -0400 Subject: Run apt-get update in initial bootstrap. For eg, Linode, which brings up hosts that have not updated at all so apt-get install doesn't work. --- debian/changelog | 6 ++++++ src/Propellor/CmdLine.hs | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) (limited to 'src/Propellor/CmdLine.hs') diff --git a/debian/changelog b/debian/changelog index 3c84ac91..dca286be 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +propellor (0.8.1) UNRELEASED; urgency=medium + + * Run apt-get update in initial bootstrap. + + -- Joey Hess Mon, 07 Jul 2014 02:03:46 -0400 + propellor (0.8.0) unstable; urgency=medium * Completely reworked privdata storage. There is now a single file, diff --git a/src/Propellor/CmdLine.hs b/src/Propellor/CmdLine.hs index bc5421e7..7b39cd24 100644 --- a/src/Propellor/CmdLine.hs +++ b/src/Propellor/CmdLine.hs @@ -210,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 " && " -- cgit v1.3-2-g0d8e