From ceb514c1e2e260cd9f027a24e9c80915e263a03d Mon Sep 17 00:00:00 2001 From: Correl Roush Date: Fri, 23 Feb 2018 09:50:30 -0500 Subject: [PATCH] [provisioning] update brew recipe - Always ensure dependencies are installed - Add gawk as a dependency (needed to build glibc for most packages on older systems) --- recipes/brew | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/recipes/brew b/recipes/brew index a2c3644..9ad496b 100644 --- a/recipes/brew +++ b/recipes/brew @@ -1,24 +1,6 @@ #!/bin/bash set +e -function __install_brew { - case "$(uname -s)" in - Darwin) - /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" - ;; - *) - _recipe _apt - _recipe _path - - for pkg in build-essential curl file git python-setuptools; do - _apt $pkg - done - [ -d ~/.linuxbrew ] || git clone -q https://github.com/Linuxbrew/brew.git ~/.linuxbrew - _path "$HOME/.linuxbrew/bin:$HOME/.linuxbrew/sbin" - ;; - esac -} - function _brew { local pkg=$1 if ! brew ls $pkg >/dev/null 2>&1; then @@ -28,6 +10,22 @@ function _brew { fi } -if ! which brew >/dev/null; then - _run "Install brew" __install_brew -fi +case "$(uname -s)" in + Darwin) + if ! which brew >/dev/null; then + _run "Install brew" /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" + fi + ;; + *) + _recipe _apt + _recipe _path + + for pkg in build-essential curl file gawk git python-setuptools; do + _apt $pkg + done + if ! [ -d ~/.linuxbrew ]; then + _run "Install brew" git clone -q https://github.com/Linuxbrew/brew.git ~/.linuxbrew + _path "$HOME/.linuxbrew/bin:$HOME/.linuxbrew/sbin" + fi + ;; +esac