#!/bin/bash

DIST=$1
ARCH=$2
BASE=$3

BUILDING=$BASE/BuildInProgress

if [ -f $BUILDING ]; then
	echo "Build in progress, quitting"
	exit 1
fi

cd $BASE

rm -f build.log *deb

mv ubuntu-2.6/.git saved.git
find ubuntu-2.6/. -maxdepth 1 -mindepth 1 | xargs rm -rf
mv saved.git ubuntu-2.6/.git

cd ubuntu-2.6
git-checkout -f
