#!/bin/bash
set -e

git clone https://github.com/vojtechtrefny/pyblkid opengnsys-pyblkid
cd opengnsys-pyblkid
version=`python3 ./setup.py --version`
cd ..

if [ -d "opengnsys-pyblkid-${version}" ] ; then
	echo "Directory opengnsys-pyblkid-${version} already exists, won't overwrite"
	exit 1
else
	rm -rf opengnsys-pyblkid/.git
	mv opengnsys-pyblkid "opengnsys-pyblkid-${version}"
	tar -c --xz -v -f "opengnsys-pyblkid_${version}.orig.tar.xz" "opengnsys-pyblkid-${version}"
fi

