source: gs3-extensions/mars-src/trunk/devel.bash

Last change on this file was 34660, checked in by davidb, 3 years ago

Change in how version of python is determined

File size: 2.4 KB
Line 
1#!/bin/bash
2
3#if [ -d cascade-make ] ; then
4# source cascade-make/lib/cascade-lib.bash GEXT_MARS . $*
5#fi
6
7_full_pyver_=$(python -V 2>&1 | grep -Po '(?<=Python )(.+)')
8_pyver_=${_full_pyver_%%.*}
9
10#_pyver_=${1-3} # default to Python v3
11
12#if [ "x$1" = "x" ] ; then
13# echo "" >&2
14# echo "Usage: source ${BASH_SOURCE} 2|3" >&2
15# echo " where '2' specifies Python v2 is to be used" >&2
16# echo " where '3' specifies Python v3 is to be used" >&2
17# echo "" >&2
18# return 1
19#fi
20
21
22
23if [ "x$GEXT_MARS" = "x" ] ; then
24 source ./setup.bash
25fi
26
27if [ ! -f "$GEXT_MARS_INSTALLED/virtualenv-python$_pyver_/bin/activate" ] ; then
28 echo "" >&2
29 echo "!!!!" >&2
30 echo "! Failed to find:" >&2
31 echo "! $GEXT_MARS_INSTALLED/virtualenv-python$_pyver_/bin/activate" >&2
32 echo "!" >&2
33 echo "! Have you run:" >&2
34 echo "! ./CREATE-VEN-PYTHON$_pyver_.sh" >&2
35 echo "!" >&2
36 echo "! Followed by:" >&2
37 echo "! source $GEXT_MARS_INSTALLED/virtualenv-python$_pyver_/bin/activate" >&2
38 echo "!!!!" >&2
39 echo "" >&2
40
41 # Uncomment the following if you want to stop everything immediately
42 #
43 # While it is commented out, it means the issue is flagged, but
44 # allows for the circumstance that the developer is (for some reason)
45 # needing to make use of a version of pythno outside of the MARS_EXT arae
46 #
47 # return 1
48
49elif [ "x$VIRTUAL_ENV" = "x" ] ; then
50 # It exists, but it hasn't been activated
51 echo ""
52 echo "****"
53 echo "* Warning: To run"
54 echo "* ./CASCADE-MAKE.sh"
55 echo "*"
56 echo "* You first need to activate Python v$_pyver_ Virtual Env:"
57 echo "* source $GEXT_MARS_INSTALLED/virtualenv-python$_pyver_/bin/activate"
58 echo "*"
59 echo "* So you have a version of the python scripting language under user control"
60 echo "* where the 'essentia' build can be installed as a site-package"
61 echo "****"
62 echo ""
63elif [ "$VIRTUAL_ENV" != "$GEXT_MARS_INSTALLED/virtualenv-python$_pyver_" ] ; then
64 # A python virtual env is in play, but not the one for Python v$_pyver_ in the MARS_EXT area
65 echo ""
66 echo "****"
67 echo "* Warning: VIRTUAL_ENV points to different location to the one in MARS_EXT"
68 echo "* VIRTUAL_ENV = $VIRTUAL_ENV"
69 echo "* MARS_EXT python$_pyver_ = $GEXT_MARS_INSTALLED/virtualenv-python$_pyver_"
70 echo "****"
71 echo ""
72fi
73
74export GEXT_MARS_DEVEL=1
75
76
Note: See TracBrowser for help on using the repository browser.