From ac64b37ac76a145ff80eef1d8764f8ab3566395b Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 7 Mar 2016 16:54:23 -0400 Subject: refactor --- src/Propellor/Bootstrap.hs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'src/Propellor/Bootstrap.hs') 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) $ -- cgit v1.2.3