#!/bin/sh
#
# Script file to update the Bacula version
#  It only needs to be run once for each version.
#  Alternatively, you can simply edit the file
#   manuals/version.tex and put the correct version and date
#   in that file.
# The only thing this script does is to create the file:
#   manuals/version.tex which contains the VERSION and the DATE
#   on a single line.
#
BACULA_SOURCE=${bacula:-$HOME/bee/bacula}/bacula/src
VERSIONH=${versionh:-${BACULA_SOURCE}/version.h}
VERSIONTEX=${versiontex:-latex/version.tex}
VERSION=`sed -n -e 's/^#define VERSION.*"\(.*\)"$/\1/p' ${VERSIONH}`
DATE=`sed -n -e 's/^#define BDATE.*"\(.*\)"$/\1/p' ${VERSIONH}`
echo "${VERSION} (${DATE})" >${VERSIONTEX}
echo "Updated version to:"
cat ${VERSIONTEX}
