#!/bin/sh
#
# Copyright 2007 Bernardo Innocenti <bernie@codewiz.org>
#
# Cron job to sync svn -> git
# 

export GIT_DIR=~/gcc.git
lock=$HOME/tmp/update-toolchain.lock

export PATH=/usr/local/bin:$PATH

if [ -s $lock ]; then
	if kill -0 `cat $lock`; then
		echo >&2 "Uh-oh, another instance appears to be running! Bailing out..."
		exit 1
	fi
	echo >&2 "Overwriting stale lockfile $lock."
fi
echo $$ >$lock
trap "/bin/rm $lock" EXIT SIGINT SIGTERM SIGQUIT

cd $GIT_DIR
git svn -q fetch >/dev/null
#git fetch -q . remotes/gcc.gnu.org
git update-server-info


