lib/scripts/polyml-version
author wenzelm
Thu, 27 Feb 2014 12:37:43 +0100
changeset 55781 b3a4207fb9a6
parent 41515 2b456655b077
permissions -rwxr-xr-x
proper update of text perspective for nodes with changed blobs, which is important to refresh the corresponding command perspective (otherwise it might refer to invalid thy_load commands and cause full execution of the node by the prover);

#!/usr/bin/env bash
#
# polyml-version --- determine Poly/ML runtime system version

if [ -x "$ML_HOME/polyml-version" ]; then
  "$ML_HOME/polyml-version"
elif [ -x "$ML_HOME/poly" ]; then
  VERSION="$(env \
    LD_LIBRARY_PATH="$ML_HOME:$ML_HOME/../lib:$LD_LIBRARY_PATH" \
    DYLD_LIBRARY_PATH="$ML_HOME:$ML_HOME/../lib:$DYLD_LIBRARY_PATH" \
    "$ML_HOME/poly" -v -H 10)"
  REGEXP='^Poly/ML.*RTS version: [^ ]*(-[^ ]*).*$'
  if [[ "$VERSION" =~ $REGEXP ]]; then
    echo "polyml${BASH_REMATCH[1]}"
  else
    echo polyml-undefined
  fi
else
  echo polyml-undefined
fi