#!/bin/sh -e

TAR=../plexus-component-metadata_$2.orig.tar.gz
DIR=plexus-component-metadata-$2
TAG=$(echo plexus-containers-$2 | sed 's/~\(alpha\|beta\)/-\1-/')

svn export http://svn.codehaus.org/plexus/plexus-containers/tags/$TAG/plexus-component-metadata $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
