source: main/trunk/greenstone3/ext-cli/get-selfcontained-python3.sh@ 37163

Last change on this file since 37163 was 36781, checked in by davidb, 20 months ago

Initial script to make it easier to get going with Python3

  • Property svn:executable set to *
File size: 1.6 KB
Line 
1#!/bin/bash
2
3OS_UPPERCASE=`uname -s | tr '[:lower:]' '[:upper:]' | sed 's/_.*$//'`
4OS_LOWERCASE=`uname -s | tr '[:upper:]' '[:lower:]' | sed 's/_.*$//'`
5
6selfcon_ext=selfcontained-python3
7installed_dir=${selfcon_ext}/${OS_LOWERCASE}-64bit
8
9echo ""
10if [ ! -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
19else
20 echo "Detected directory '$selfcon_ext'"
21 echo "=> Taken to mean that the svn check-out command has already been run"
22fi
23
24echo ""
25if [ ! -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
36else
37 echo "Detected directory '$installed_dir'"
38 echo "=> Taken to mean that the $selfcon_ext/PREPARE-${OS_UPPERCASE}.sh command has already been run"
39fi
40
41
42if [ "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 ""
47else
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"
51fi
52
53echo ""
Note: See TracBrowser for help on using the repository browser.