#!/bin/bash _full_pyver_=$(python3 -V 2>&1 | grep -Po '(?<=Python )(.+)') _pyver_=${_full_pyver_%%.*} if [ "x$_pyver_" = "x" ] ; then echo "" >&2 echo "Failed to establish the full version of python" >&2 echo "Defaulting to version 3" >&2 _pyver_=3 fi if [ "x$GEXT_STRUCTURED_AUDIO" = "x" ] ; then source ./setup.bash fi if [ ! -f "$GEXT_STRUCTURED_AUDIO_INSTALLED/virtualenv-python$_pyver_/bin/activate" ] ; then echo "" >&2 echo "!!!!" >&2 echo "! Failed to find:" >&2 echo "! $GEXT_STRUCTURED_AUDIO_INSTALLED/virtualenv-python$_pyver_/bin/activate" >&2 echo "!" >&2 echo "! Have you run:" >&2 echo "! ./CREATE-VEN-PYTHON$_pyver_.sh" >&2 echo "!" >&2 echo "! Followed by:" >&2 echo "! source $GEXT_STRUCTURED_AUDIO_INSTALLED/virtualenv-python$_pyver_/bin/activate" >&2 echo "!!!!" >&2 echo "" >&2 # Uncomment the following if you want to stop everything immediately # # While it is commented out, it means the issue is flagged, but # allows for the circumstance that the developer is (for some reason) # needing to make use of a version of python outside of this extension's area # # return 1 elif [ "$VIRTUAL_ENV" != "$GEXT_STRUCTURED_AUDIO_INSTALLED/virtualenv-python$_pyver_" ] ; then # A python virtual env is in play, but not the one for Python v$_pyver_ in this extension's area echo "" echo "****" echo "* Warning: VIRTUAL_ENV points to different location to the one in $GEXT_STRUCTURED_AUDIO" echo "* VIRTUAL_ENV = $VIRTUAL_ENV" echo "* Extension's python$_pyver_ = $GEXT_STRUCTURED_AUDIO_INSTALLED/virtualenv-python$_pyver_" echo "****" echo "" fi export GEXT_STRUCTURED_AUDIO_DEVEL=1