#!/bin/sh -e

# called by uscan with '--upstream-version' <version> <file>
DIR=ehcache-$2.orig
TAR=../ehcache_$2.orig.tar.xz

# clean up the upstream tarball
svn export http://svn.terracotta.org/svn/ehcache/tags/ehcache-core-$2/ $DIR
# FIXME: check PDF and DOC files
XZ_OPT=--best tar cJf $TAR -X debian/orig-tar.exclude $DIR
rm -rf $DIR ../ehcache-core-$2

# move to directory 'tarballs'
if [ -r .svn/deb-layout ]; then
    . .svn/deb-layout
    mv $TAR $origDir
    echo "moved $TAR to $origDir"
fi

