#!/bin/bash
# $Id: relver.bash 696 2020-02-11 18:59:06Z toni $
# Quick and dirty script to retrieve the script version
# (which is otherwise composed at runtime)
# This scripts avoid having the same runtime requirements for package
# creation

r="$(dirname "$0")/../src/relevation/__init__.py"

rel=$(grep '^RELEASE' $r | tail -1)
verinfo=$(grep '^__version_info__' $r | head -1)
verinfo_pre=$(grep '__version_info__ +=' $r | head -1 | sed 's/^[[:space:]]*//')
ver=$(grep '^__version__' $r | head -1)

python <<EOF
$rel
$verinfo
release=''
if not RELEASE:
	$verinfo_pre
	release=' [DEBUG]'
$ver
print "%s%s" % ( __version__, release )
EOF

