summaryrefslogtreecommitdiff
path: root/src/Propellor/Bootstrap.hs
diff options
context:
space:
mode:
authorJoey Hess2015-04-29 14:41:46 -0400
committerJoey Hess2015-04-29 14:41:46 -0400
commit6288393b4b5e413b2634b0ea59cbc8713061d5cd (patch)
tree618a379cde3339382ac6db23842801e8156542a1 /src/Propellor/Bootstrap.hs
parent2148a75746d522add684f23928f4aec6b619f5ec (diff)
avoid checking build deps if cabal configures ok
Diffstat (limited to 'src/Propellor/Bootstrap.hs')
-rw-r--r--src/Propellor/Bootstrap.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/Propellor/Bootstrap.hs b/src/Propellor/Bootstrap.hs
index 260d8117..51ba69a4 100644
--- a/src/Propellor/Bootstrap.hs
+++ b/src/Propellor/Bootstrap.hs
@@ -17,7 +17,7 @@ type ShellCommand = String
-- Should be run inside the propellor config dir, and will install
-- all necessary build dependencies and build propellor.
bootstrapPropellorCommand :: ShellCommand
-bootstrapPropellorCommand = depsCommand ++
+bootstrapPropellorCommand = checkDepsCommand ++
"&& if ! test -x ./propellor; then "
++ buildCommand ++
"; fi;" ++ checkBinaryCommand
@@ -39,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