Added version check.

This commit is contained in:
Achim D. Brucker 2018-04-08 15:58:18 +01:00
parent 77cfc621aa
commit c336aee16f
2 changed files with 25 additions and 3 deletions

View File

@ -36,8 +36,8 @@ ROOT_NAME="root_$NAME"
if [ ! -f $ISABELLE_HOME_USER/DOF/lib/dof_latex_converter.jar ]; then
echo ""
echo " Warning"
echo " ======="
echo "Warning: Isabelle DOF not installed"
echo "========"
echo "This is a Isabelle_DOF project. The document preparation requires"
echo "the Isabelle_DOF framework. Please obtain the framework by cloning"
echo "the Isabelle_DOF git repository, i.e.: "
@ -49,6 +49,24 @@ if [ ! -f $ISABELLE_HOME_USER/DOF/lib/dof_latex_converter.jar ]; then
exit 1
fi
VERSION=$($ISABELLE_TOOL scala $ISABELLE_HOME_USER/DOF/lib/dof_latex_converter.jar -v) || true
if [ "$VERSION" != "<VERSION>" ]; then
echo ""
echo "Warning: Isabelle DOF version mismatch"
echo "========"
echo " Build script version: <VERSION>"
echo " DOF LaTeX Converter version: $VERSION"
echo " Please take one of the following actions:"
echo " * If the build script is more recent than the converter, "
echo " then update the build script from your your Isabelle DOF"
echo " installation:"
echo " $ISABELLE_HOME_USER/DOF/document-template/build"
echo " * If the converter is more recent than the build script,"
echo " please update your Isabelle DOF installation."
exit 1
fi
$ISABELLE_TOOL scala $ISABELLE_HOME_USER/DOF/lib/dof_latex_converter.jar .
cp $ISABELLE_HOME_USER/DOF/latex/DOF.sty .

View File

@ -55,14 +55,18 @@ echo "Installing library in $DIR"
mkdir -p "$DIR"
cp converter/bin/*.jar "$DIR"
VERSION=`$ISABELLE scala converter/bin/*.jar -v`
DIR="$ISABELLE_HOME_USER/DOF/document-template"
echo "Installing document templates in $DIR"
mkdir -p "$DIR"
cp document-template/* "$DIR"
sed -i -e "s/<VERSION>/$VERSION/" "$DIR"/build
DIR="$ISABELLE_HOME_USER/DOF/latex"
echo "Installing LaTeX styles in $DIR"
mkdir -p "$DIR"
cp latex/*.sty "$DIR"
echo "Installation successful."
echo "Installation of $VERSION successful."