#!/bin/sh

set -e

TAR=../maven-site-plugin_$2.orig.tar.gz
DIR=maven-site-plugin-$2
TAG=$(echo maven-site-plugin-$2 | sed -e's,~beta,-beta-,')

svn export http://svn.apache.org/repos/asf/maven/plugins/tags/$TAG $DIR
tar -c -z -f $TAR $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
