#!/bin/sh -e

VERSION=$2
TAR=../octopussy_$VERSION.orig.tar.gz
DIR=octopussy-$VERSION
TAG=$(echo "Octopussy-$VERSION" | sed -re's/~rc/rc/')

svn export https://syslog-analyzer.svn.sourceforge.net/svnroot/syslog-analyzer/tags/${TAG}/ $DIR
GZIP=--best tar -c -z -f $TAR --exclude '*.swf' $DIR
rm -rf $DIR ../$TAG

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