diff options
| author | Joey Hess <joeyh@joeyh.name> | 2015-04-02 10:26:51 -0400 |
|---|---|---|
| committer | Joey Hess <joeyh@joeyh.name> | 2015-04-02 10:26:51 -0400 |
| commit | 006b1c35854c134cbdf33303836c2461322ed463 (patch) | |
| tree | 223b7281c3b0f5b3c86c141591accf4f610467f5 /src/Propellor/Bootstrap.hs | |
| parent | 3cbabe3f765b7e11db32992a5c9a349fc19d0858 (diff) | |
| parent | 1413e9c61970532b846893ca6435f2a2785a1b02 (diff) | |
Merge branch 'joeyconfig'
Diffstat (limited to 'src/Propellor/Bootstrap.hs')
| -rw-r--r-- | src/Propellor/Bootstrap.hs | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/Propellor/Bootstrap.hs b/src/Propellor/Bootstrap.hs index 214f65d5..a07347ed 100644 --- a/src/Propellor/Bootstrap.hs +++ b/src/Propellor/Bootstrap.hs @@ -1,5 +1,6 @@ module Propellor.Bootstrap ( bootstrapPropellorCommand, + checkBinaryCommand, installGitCommand, buildPropellor, ) where @@ -12,17 +13,27 @@ import Data.List type ShellCommand = String --- Shell command line to build propellor, used when bootstrapping on a new --- host. Should be run inside the propellor config dir, and will install --- all necessary build dependencies. +-- Shell command line to ensure propellor is bootstrapped and ready to run. +-- 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" +bootstrapPropellorCommand = "if ! test -x ./propellor; then " ++ go ++ "; fi;" ++ checkBinaryCommand where - go = intercalate " && " + go = intercalate " && " [ depsCommand , buildCommand ] +-- Use propellor --check to detect if the local propellor binary has +-- stopped working (eg due to library changes), and must be rebuilt. +checkBinaryCommand :: ShellCommand +checkBinaryCommand = "if test -x ./propellor && ! ./propellor --check 2>/dev/null; then " ++ go ++ "; fi" + where + go = intercalate " && " + [ "cabal clean" + , buildCommand + ] + buildCommand :: ShellCommand buildCommand = intercalate " && " [ "cabal configure" |
