From c4456fdba51eb58baf106320f5dc8348b041e533 Mon Sep 17 00:00:00 2001 From: Tom Morris Date: Mon, 18 Oct 2010 06:14:53 +0000 Subject: [PATCH] Look for Python 2.6 if default installation is Python 2.7 git-svn-id: http://google-refine.googlecode.com/svn/trunk@1603 7d457c2a-affb-35e4-300a-418c747d4874 --- refine | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/refine b/refine index 4ee569672..56e39d8dc 100755 --- a/refine +++ b/refine @@ -124,9 +124,16 @@ check_python() { if [ -z "$PYTHON" ] ; then error "This action requires you to have 'python' installed and present in your PATH. You can download it for free at http://www.python.org/" fi - PYTHON_VERSION="`python --version 2>&1 | cut -f 2 -d ' ' | cut -f 1,2 -d .`" - if [ "$PYTHON_VERSION" != "2.5" ] && [ "$PYTHON_VERSION" != "2.6" && [ "$PYTHON_VERSION" != "2.7" ]] ; then - error "This action requires python version 2.5.x, 2.6.x or 2.7.x. You can download it for free at http://www.python.org/" + PYTHON_VERSION="`$PYTHON --version 2>&1 | cut -f 2 -d ' ' | cut -f 1,2 -d .`" + if [ "$PYTHON_VERSION" = "2.7" ] ; then + PYTHON="`which python2.6 2> /dev/null`" + if [ -z "$PYTHON" ] ; then + error "Default Python is v2.7 which not supported by Windmill. No python2.6 alternative found on path." + fi + PYTHON_VERSION="`$PYTHON --version 2>&1 | cut -f 2 -d ' ' | cut -f 1,2 -d .`" + fi + if [ "$PYTHON_VERSION" != "2.5" ] && [ "$PYTHON_VERSION" != "2.6" ]] ; then + error "This action requires python version 2.5.x, 2.6.x. You can download it for free at http://www.python.org/" fi }