#!/bin/sh

set -e

VERSION=$2
FILE=$3

NEWVERSION=${VERSION}+dfsg
NEWFILE=../python-evtx_${NEWVERSION}.orig.tar.xz

echo "Generating ${NEWFILE} ..."
zcat $FILE \
    | tar --wildcards --delete -f - '*/documentation/p65-schuster.pdf' \
    | xz -c > ${NEWFILE}.t

mv ${NEWFILE}.t ${NEWFILE}
