1 | #!/bin/bash
|
---|
2 |
|
---|
3 | OS_UPPERCASE=`uname -s | tr '[:lower:]' '[:upper:]' | sed 's/_.*$//'`
|
---|
4 | OS_LOWERCASE=`uname -s | tr '[:upper:]' '[:lower:]' | sed 's/_.*$//'`
|
---|
5 |
|
---|
6 | selfcon_ext=selfcontained-python3
|
---|
7 | installed_dir=${selfcon_ext}/${OS_LOWERCASE}-64bit
|
---|
8 |
|
---|
9 | echo ""
|
---|
10 | if [ ! -d $selfcon_ext ] ; then
|
---|
11 | echo "Checking out from svn: Greenstone3's $selfcon_ext extension"
|
---|
12 | svn co https://svn.greenstone.org/gs3-extensions/$selfcon_ext/trunk $selfcon_ext
|
---|
13 |
|
---|
14 | if [ $? != 0 ] ; then
|
---|
15 | echo "Error encountered checking out: " 1>&2
|
---|
16 | echo " svn co https://svn.greenstone.org/gs3-extensions/$selfcon_ext/trunk $selfcon_ext" 1>&2
|
---|
17 | exit 1
|
---|
18 | fi
|
---|
19 | else
|
---|
20 | echo "Detected directory '$selfcon_ext'"
|
---|
21 | echo "=> Taken to mean that the svn check-out command has already been run"
|
---|
22 | fi
|
---|
23 |
|
---|
24 | echo ""
|
---|
25 | if [ ! -d $installed_dir ] ; then
|
---|
26 | echo "Runing the $selfcon_ext/PREPARE-${OS_UPPERCASE}.sh"
|
---|
27 |
|
---|
28 | cd $selfcon_ext && ./PREPARE-${OS_UPPERCASE}.sh
|
---|
29 |
|
---|
30 | if [ $? != 0 ] ; then
|
---|
31 | echo "Error encountered running: " 1>&2
|
---|
32 | echo " cd $selfcon_ext && ./PREPARE-${OS_UPPERCASE}.sh" 1>&2
|
---|
33 | exit 1
|
---|
34 | fi
|
---|
35 |
|
---|
36 | else
|
---|
37 | echo "Detected directory '$installed_dir'"
|
---|
38 | echo "=> Taken to mean that the $selfcon_ext/PREPARE-${OS_UPPERCASE}.sh command has already been run"
|
---|
39 | fi
|
---|
40 |
|
---|
41 |
|
---|
42 | if [ "x$PYTHON3_HOME" != "x$PWD/$installed_dir" ] ; then
|
---|
43 | echo ""
|
---|
44 | echo "To use this installed version of Python3, in the top-level Greenstone3 directory run:"
|
---|
45 | echo " source ./gs3-setup-cli.sh"
|
---|
46 | echo ""
|
---|
47 | else
|
---|
48 | echo ""
|
---|
49 | echo "Detected PYTHON3_HOME set to \$PWD/$installed_dir"
|
---|
50 | echo "=> Taken to mean that the $selfcon_ext SETUP.sh file has been sourced"
|
---|
51 | fi
|
---|
52 |
|
---|
53 | echo ""
|
---|