#!/bin/sh
#
# new-upstream: copyright 2007,2008 by Vincent Fourmond.
# See debian/copyright file for details.
#
# Called by uscan; from uscan(1):
#
# Finally,  if a third parameter (an action) is given in the watchfile
# line, this is taken as the name of a command, and the command
#  command --upstream-version version filename
# 
# is executed, using either the original file or the symlink name.
#
# Thanks to Sam Morris <sam@robots.org.uk> for giving me the idea

set -e

version=$2
filename=$3

dir=xmlgraphics-commons-*

# We repackage the upstream tarball, removing the jars in the library and
# the examples, which have dubious copyright status
tar xzf $filename --exclude '*/lib/*.jar'

# We repackage excluding the lib/ subdir
tar cz -f $filename xml*

rm -rf $dir
