[Zope-Checkins] CVS: Zope - configure:1.1.4.13

Chris McDonough chrism@zope.com
Mon, 25 Nov 2002 23:32:05 -0500


Update of /cvs-repository/Zope
In directory cvs.zope.org:/tmp/cvs-serv2343

Modified Files:
      Tag: chrism-install-branch
	configure 
Log Message:
Configure now orders acceptable versions.


=== Zope/configure 1.1.4.12 => 1.1.4.13 ===
--- Zope/configure:1.1.4.12	Tue Oct 22 19:20:27 2002
+++ Zope/configure	Mon Nov 25 23:32:05 2002
@@ -4,6 +4,29 @@
 # $Id$
 # $Revision$
 
+#####################################################################
+#                    BEGIN EDITABLE PARAMETERS                      #
+#####################################################################
+
+# Place the optimal target version number for Zope (as returned by sys.version)
+# below
+TARGET="2.2.2"
+
+# Order a list of "acceptable" python version numbers (as returned by
+# sys.version) below in "best" to "worst" order.  Up to six
+# acceptable python versions are allowed.  Do not include the target
+# version number in this list.
+ACCEPTABLE="2.3a0 2.3"
+
+# provide the executable names for all the acceptable versions
+# (and the target version) below
+EXENAMES="python python2 python2.1 python2.2 python2.3"
+
+#####################################################################
+#                    END EDITABLE PARAMETERS                        #
+#####################################################################
+
+# where are we?
 HERE=`dirname $0`
 
 usage()
@@ -27,13 +50,10 @@
 }
 
 get_python()
+# bootstrap ourselves by finding a Python interpreter if necessary
 {
-    # bootstrap ourselves by finding a Python interpreter if necessary
     OLDIFS="$IFS"
     IFS=":"
-    TARGET="2.2.2"
-    ACCEPTABLE="2.1.2 2.1.1 2.1.0 2.2.1 2.2.2 2.2 2.3"
-    EXENAMES="python python2 python2.1 python2.2 python2.3"
     FOUND=""
     VERSION=""
     echo "Testing for an acceptable Python interpreter..."
@@ -51,35 +71,59 @@
 		    FOUNDVERSION=$VERSION
 		    break 2
 		else
+                    i=1;
 		    for ACC in $ACCEPTABLE; do
+			let "i = i + 1"
 			if [ "$VERSION" = "$ACC" ]; then
-			    FOUND=$FULL
-			    FOUNDVERSION=$VERSION
+			    eval "FOUND$i=$FULL"
+			    eval "FOUNDVERSION$i=$VERSION"
 			fi
 		    done
 		fi
 	    fi
 	done
     done
-    if [ -z "$FOUND" ]; then
+    if [ -z "$FOUND1" ] && [ -z "$FOUND2" ] && [ -z "$FOUND3" ] && 
+       [ -z "$FOUND4" ] && [ -z "$FOUND5" ] && [ -z "$FOUND6" ] ; then
         echo
-	echo "  No suitable Python version found.  You must install Python"
+	echo "  No suitable Python version found.  You should install Python"
 	echo "  version $TARGET before continuing.  Versions $ACCEPTABLE"
 	echo "  also work, but not as optimally."
 	exit 127
-    elif [ "$VERSION" = "$TARGET" ]; then
+    elif [ "$FOUNDVERSION" = "$TARGET" ]; then
         echo
 	echo "  The optimimum Python version ($TARGET) was found at $FOUND."
     else
+        if   [ -n "$FOUND1" ]; then
+            FOUND=$FOUND1
+            FOUNDVERSION=$FOUNDVERSION1
+        elif [ -n "$FOUND2" ]; then
+            FOUND=$FOUND2
+            FOUNDVERSION=$FOUNDVERSION2
+        elif [ -n "$FOUND3" ]; then
+            FOUND=$FOUND3
+            FOUNDVERSION=$FOUNDVERSION3
+        elif [ -n "$FOUND4" ]; then
+            FOUND=$FOUND4
+            FOUNDVERSION=$FOUNDVERSION4
+        elif [ -n "$FOUND5" ]; then
+            FOUND=$FOUND5
+            FOUNDVERSION=$FOUNDVERSION5
+        elif [ -n "$FOUND6" ]; then
+            FOUND=$FOUND6
+            FOUNDVERSION=$FOUNDVERSION6
+        fi
         echo
 	echo "  !! WARNING !! "
 	echo "  An acceptable, but non-optimal Python version ($FOUNDVERSION) "
-	echo "  was found at '$FOUND' but consider installing version $TARGET"
-	echo "  before running 'make'.  If this isn't the Python version or"
-        echo "  interpreter instance you wish to use, you may specify a Python"
-        echo "  interpreter manually by rerunning the ./configure script with "
-        echo "  the --with-python option."
-fi
+	echo "  was found at: "
+        echo "      $FOUND"
+        echo "  but consider installing version '$TARGET' before running "
+        echo "  'make'.  If this isn't the Python version or interpreter "
+        echo "  instance you wish to use, you may specify a Python interpreter"
+        echo "  manually by rerunning the ./configure script with the "
+        echo "  --with-python option."
+    fi
 echo
 }