From a7503d1b107656f0635d6d965d0dca9bdda7839f Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sun, 3 Apr 2016 12:00:30 -0700 Subject: typo --- src/Propellor/DotDir.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Propellor/DotDir.hs') diff --git a/src/Propellor/DotDir.hs b/src/Propellor/DotDir.hs index 4f27788d..c911513a 100644 --- a/src/Propellor/DotDir.hs +++ b/src/Propellor/DotDir.hs @@ -115,7 +115,7 @@ setup :: IO () setup = do sayLn "Propellor's configuration file is ~/.propellor/config.hs" sayLn "" - sayLn "Lets get you started with a simple config that you can adapt" + sayLn "Let's get you started with a simple config that you can adapt" sayLn "to your needs. You can start with:" sayLn " A: A clone of propellor's git repository (most flexible)" sayLn " B: The bare minimum files to use propellor (most simple)" -- cgit v1.2.3 From d53fb1907bab2da6c19bd83e5140149d7579740c Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sun, 3 Apr 2016 12:13:25 -0700 Subject: propellor --init inits a cabal sandbox when needed --- src/Propellor/DotDir.hs | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/Propellor/DotDir.hs') diff --git a/src/Propellor/DotDir.hs b/src/Propellor/DotDir.hs index c911513a..3bf66c2b 100644 --- a/src/Propellor/DotDir.hs +++ b/src/Propellor/DotDir.hs @@ -66,6 +66,21 @@ interactiveInit = ifM (doesDirectoryExist =<< dotPropellor) setup ) +-- | Determine whether we need to create a cabal sandbox in ~/.propellor/, +-- which we do if the user has configured cabal to require a sandbox, and the +-- build system is cabal. +cabalSandboxRequired :: IO Bool +cabalSandboxRequired = ifM cabal + ( do + home <- myHomeDir + ls <- lines <$> readFile (home ".cabal" "config") + -- For simplicity, we assume a sane ~/.cabal/config here: + return $ "require-sandbox: True" `elem` ls + , return False + ) + where + cabal = buildSystem >>= \bSystem -> return (bSystem == "cabal") + say :: String -> IO () say = outputConcurrent @@ -134,6 +149,13 @@ setup = do , Param "propellor.buildsystem" , Param b ] + ifM cabalSandboxRequired + ( void $ boolSystem "cabal" + [ Param "sandbox" + , Param "init" + ] + , return () + ) buildPropellor Nothing sayLn "" sayLn "Great! Propellor is bootstrapped." -- cgit v1.2.3