#!/bin/sh

# copyright 2006 Holger Levsen
# released under the GPL version2
#
# attack of the ugly scripts! i think i want to learn about svn-buildpackage next...

if [ "$1" == "" ] ; then echo "upstream version missing, e.g. 0.97"; exit 1 ; fi

mkdir -p results
cd results 

#
# checkout the code from svn if no local tuxmath_${1}.orig.tar.gz  exists
# (this allows local modifications to the debian directory)
#
if [ ! -e ./tuxmath_${1}.orig.tar.gz ] ; then
        cd ../../../
	cp -ax trunk tuxmath-${1}
	tar --exclude=".svn" -c -z -v -f people/holger/results/tuxmath_${1}.orig.tar.gz tuxmath-${1}/
	rm tuxmath-${1} -rf
 	cd people/holger
else
	cd ..
	echo tuxmath_${1}.orig.tar.gz already exists, exiting
	exit 1 
fi
