Skip to content
Browse files

removed code that attempted to guess where the system python installa…

…tion is,in an attempt to make installation more generic

svn/trunk@8490
  • Loading branch information...
1 parent e81fc7d commit c8d73f5e5d2ffe9e3e354da065aabbe4b24c4da5 @stevenbird stevenbird committed Feb 5, 2010
Showing with 11 additions and 19 deletions.
  1. +11 −19 MacResources/postflight.sh
View
30 MacResources/postflight.sh
@@ -8,29 +8,21 @@
TMP=/tmp/nltk-installer/
cd $TMP
-# test for python version
-#first see if python from the default install is there
-if [ -e /System/Library/Frameworks/Python.framework/Versions/2.5/bin/python ]
+MINPYVERMAJOR=2
+MINPYVERMINOR=4
+PYVER=`python -V 2>&1 | sed 's/Python \([0-9]\.[0-9]\).*/\1/'`
+PYMAJOR=`echo $PYVER | sed 's/\([0-9]\)\.\([0-9]\)/\1/'`
+PYMINOR=`echo $PYVER | sed 's/\([0-9]\)\.\([0-9]\)/\2/'`
+
+# if [[ ( "$PYMAJOR" -ge "$MINPYVERMAJOR" ) \ permits Python 3
+
+if [[ ( "$PYMAJOR" -eq "$MINPYVERMAJOR" && "$PYMINOR" -ge "$MINPYVERMINOR" ) ]]
then
- /usr/bin/sudo /System/Library/Frameworks/Python.framework/Versions/2.5/bin/python ./setup.py install
+ /usr/bin/sudo python ./setup.py install
else
- MINPYVERMAJOR=2
- MINPYVERMINOR=4
- PYVER=`python -V 2>&1 | sed 's/Python \([0-9]\.[0-9]\).*/\1/'`
- PYMAJOR=`echo $PYVER | sed 's/\([0-9]\)\.\([0-9]\)/\1/'`
- PYMINOR=`echo $PYVER | sed 's/\([0-9]\)\.\([0-9]\)/\2/'`
- if [[ ( "$PYMAJOR" -ge "$MINPYVERMAJOR" ) \
- || ( "$PYMAJOR" -eq "$MINPYVERMAJOR" && "$PYMINOR" -ge "$MINPYVERMINOR" ) ]]
-
- then
- /usr/bin/sudo python ./setup.py install
- else
- exit -1
- fi
+ exit -1
fi
-/usr/bin/sudo python ./setup.py install
-
# Clean up after ourselves by deleting /tmp/nltk-installer?
# rm -rf $TMP

0 comments on commit c8d73f5

Please sign in to comment.
Something went wrong with that request. Please try again.