summaryrefslogtreecommitdiff
path: root/src/Propellor/Bootstrap.hs
diff options
context:
space:
mode:
authorJoey Hess2016-03-07 16:54:23 -0400
committerJoey Hess2016-03-07 16:55:16 -0400
commitac64b37ac76a145ff80eef1d8764f8ab3566395b (patch)
treecb27d2d0858b7003fb799a27e663e0938fba067b /src/Propellor/Bootstrap.hs
parent4779718787ed3a8457e566d508668db00a918a1c (diff)
refactor
Diffstat (limited to 'src/Propellor/Bootstrap.hs')
-rw-r--r--src/Propellor/Bootstrap.hs17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/Propellor/Bootstrap.hs b/src/Propellor/Bootstrap.hs
index 6c79535f..58480832 100644
--- a/src/Propellor/Bootstrap.hs
+++ b/src/Propellor/Bootstrap.hs
@@ -107,11 +107,18 @@ depsCommand (System distr _) = "( " ++ intercalate " ; " (concat [osinstall, cab
]
installGitCommand :: System -> ShellCommand
-installGitCommand (System distr _) = case distr of
- (FreeBSD _) ->
- "if ! git --version >/dev/null; then ASSUME_ALWAYS_YES=yes pkg update && ASSUME_ALWAYS_YES=yes pkg install git; fi"
- _ ->
- "if ! git --version >/dev/null; then apt-get update && DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends --no-upgrade -y install git; fi"
+installGitCommand (System distr _) =
+ "if ! git --version >/dev/null; then " ++ intercalate " && " cmds ++ "; fi"
+ where
+ cmds = case distr of
+ (FreeBSD _) ->
+ [ "ASSUME_ALWAYS_YES=yes pkg update"
+ , "ASSUME_ALWAYS_YES=yes pkg install git"
+ ]
+ _ ->
+ [ "apt-get update"
+ , "DEBIAN_FRONTEND=noninteractive apt-get --no-install-recommends --no-upgrade -y install git"
+ ]
buildPropellor :: IO ()
buildPropellor = unlessM (actionMessage "Propellor build" build) $