#!/bin/sh

# for this to work you need to pass the --top argument after the dist name,
# otherwise it will look in /root/.autobuilder instead of $HOME/.autobuilder:
#
#  ./runlocal precise-seereason --top ${HOME}/.autobuilder --all-targets ...

AUTOBUILDER=${PWD}
CABALDEBIAN=${PWD}/../cabal-debian/src
DEBIANREPO=${PWD}/../debian-repo
DEBIAN=${PWD}/../../haskell-debian
CONFIGDIR=${HOME}/.autobuilder.d
AUTOGEN=${AUTOBUILDER}/dist/build/autogen

cd ${CONFIGDIR}
sudo runhaskell -i${AUTOGEN}:${CONFIGDIR}:${AUTOBUILDER}:${CABALDEBIAN}:${DEBIANREPO} ${CONFIGDIR}/autobuilder.hs $*
