#!/bin/bash -e


echo $*

SVNVERSION=`svn info https://svn.java.net/svn/stax-utils~svn/trunk | awk -F": " '$1=="Revision" {print $2}'`
SVNDATE=`svn info https://svn.java.net/svn/stax-utils~svn/trunk | awk -F": " '$1=="Last Changed Date" {print $2}'`
SVNDATE=`echo $SVNDATE | sed -e 's/^\(\S*\) .*/\1/; s/-//g'`

svn export https://svn.java.net/svn/stax-utils~svn/trunk
ant -f trunk/build.xml jar

jh_repack --upstream-version $SVNDATE+svn$SVNVERSION trunk/build/stax-utils-src.zip

mv trunk/build/stax-utils-src.tar.gz stax-utils_$SVNDATE+svn$SVNVERSION.orig.tar.gz

rm -rf trunk

