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

lock=$HOME/tmp/update-toolchain.lock

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 /srv/git/toolchain/gcc.git
export GIT_DIR=`pwd`
git-svn -q fetch >/dev/null
git-fetch -q . remotes/gcc.gnu.org

