From 55cd120d496736400a4d8eccb8ba573680323888 Mon Sep 17 00:00:00 2001 From: patrick brisbin Date: Thu, 25 Aug 2011 16:46:00 -0400 Subject: [PATCH] install-all.sh: small rewrite --- install-all.sh | 50 ++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/install-all.sh b/install-all.sh index 0a56e0ed..e1b3ada6 100755 --- a/install-all.sh +++ b/install-all.sh @@ -1,20 +1,42 @@ -#!/bin/sh +#!/bin/bash -e -CABAL=cabal +# allow a CABAL env var to override +CABAL=${CABAL:-cabal} # install testing dependencies -$CABAL install HUnit QuickCheck 'hspec >= 0.6.1 && < 0.7' shelltestrunner || exit 1 +$CABAL install HUnit QuickCheck 'hspec >= 0.6.1 && < 0.7' shelltestrunner -git submodule init -git submodule update +# pull submodules +git submodule update --init -PACKAGES="blaze-textual aeson authenticate yesod-core yesod-json yesod-static yesod-persistent yesod-newsfeed yesod-form yesod-auth yesod-sitemap yesod" -for package in $PACKAGES -do - echo Installing $package - cd $package - ($CABAL configure --enable-tests || - ($CABAL install --only-dependencies && $CABAL configure --enable-tests) - ) && $CABAL build && $CABAL test && ./Setup.lhs install || exit 1 - cd .. +pkgs=( blaze-textual + aeson + authenticate + yesod-core + yesod-json + yesod-static + yesod-persistent + yesod-newsfeed + yesod-form + yesod-auth + yesod-sitemap + yesod + ) + +# install each sub-respository +for pkg in "${pkgs[@]}"; do + echo "Installing $pkg..." + + ( + cd "./$pkg" + + if ! $CABAL configure --enable-tests; then + $CABAL install --only-dependencies + $CABAL configure --enable-tests + fi + + $CABAL build + $CABAL test + ./Setup.lhs install + ) done