#!/bin/sh
VERSION_CMAKE=`grep '^set(omhacks_version' CMakeLists.txt |sed -r 's/.+"([^"]+)".+/\1/'`
VERSION_DEB=`head -n 1 debian/changelog  | sed -re 's/.+\(([^-]+).+/\1/'`
VERSION="$VERSION_CMAKE"

if [ "$VERSION_CMAKE" != "$VERSION_DEB" ]
then
	echo "Version mismatch between cfget ($VERSION_CMAKE) and debian/changelog ($VERSION_DEB)" >&2
	exit 1
fi

echo "$VERSION"
exit 0
