#!/bin/sh -e

# called by uscan with '--upstream-version' <version> <file>
DIR=libcommons-collections3-java.orig

# clean up the upstream tarball
tar -z -x -f $3
mv commons-collections-$2-src $DIR
tar -c -z -f $3 --exclude '*.jar' $DIR
rm -rf $DIR

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