summaryrefslogtreecommitdiff
path: root/src/Propellor/Bootstrap.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Propellor/Bootstrap.hs')
-rw-r--r--src/Propellor/Bootstrap.hs18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/Propellor/Bootstrap.hs b/src/Propellor/Bootstrap.hs
index a07347ed..51ba69a4 100644
--- a/src/Propellor/Bootstrap.hs
+++ b/src/Propellor/Bootstrap.hs
@@ -17,12 +17,10 @@ type ShellCommand = String
-- Should be run inside the propellor config dir, and will install
-- all necessary build dependencies and build propellor.
bootstrapPropellorCommand :: ShellCommand
-bootstrapPropellorCommand = "if ! test -x ./propellor; then " ++ go ++ "; fi;" ++ checkBinaryCommand
- where
- go = intercalate " && "
- [ depsCommand
- , buildCommand
- ]
+bootstrapPropellorCommand = checkDepsCommand ++
+ "&& if ! test -x ./propellor; then "
+ ++ buildCommand ++
+ "; fi;" ++ checkBinaryCommand
-- Use propellor --check to detect if the local propellor binary has
-- stopped working (eg due to library changes), and must be rebuilt.
@@ -41,6 +39,11 @@ buildCommand = intercalate " && "
, "ln -sf dist/build/propellor-config/propellor-config propellor"
]
+-- Run cabal configure to check if all dependencies are installed;
+-- if not, run the depsCommand.
+checkDepsCommand :: ShellCommand
+checkDepsCommand = "if ! cabal configure >/dev/null 2>&1; then " ++ depsCommand ++ "; fi"
+
-- Install build dependencies of propellor.
--
-- First, try to install ghc, cabal, gnupg, and all haskell libraries that
@@ -77,7 +80,8 @@ depsCommand = "( " ++ intercalate " ; " (concat [osinstall, cabalinstall]) ++ "
, "libghc-network-dev"
, "libghc-quickcheck2-dev"
, "libghc-mtl-dev"
- , "libghc-monadcatchio-transformers-dev"
+ , "libghc-transformers-dev"
+ , "libghc-exceptions-dev"
]
installGitCommand :: ShellCommand