#!/bin/bash

. ~/bin/build-common

if [ "$system" = "" ]; then
	echo "Usage: $0 <system>"
	exit 1
fi

status=$(build-check $system)

if [ $status != "idle" ]; then
	echo "$system: $status"
	exit 1
fi

if [ "$DIST" = "dapper" ]; then
	cd /org/kernel-security/dapper/linux-source-2.6.15-2.6.15
elif [ "$DIST" = "edgy" ]; then
	cd /org/kernel-security/edgy/linux-source-2.6.17-2.6.17
else
	cd /org/linux-source-2.6.20-2.6.20
fi

echo "$system:"

echo "    pushing current tree ..."
git-send-pack $system:$BASEDIR/ubuntu-2.6 master > /dev/null 2>&1

echo "    cleaning up build area ..."
ssh $system $DOCLEAN > /dev/null 2>&1
