[Zope-Checkins] CVS: Zope - configure:1.7
Chris McDonough
chrism@zope.com
Fri, 13 Jun 2003 11:42:26 -0400
Update of /cvs-repository/Zope
In directory cvs.zope.org:/tmp/cvs-serv7027
Modified Files:
configure
Log Message:
If the target version is not found, use the first "most acceptable" version found instead of the last.
=== Zope/configure 1.6 => 1.7 ===
--- Zope/configure:1.6 Tue Jun 10 13:40:39 2003
+++ Zope/configure Fri Jun 13 11:42:25 2003
@@ -16,10 +16,10 @@
TARGET="2.2.3"
# 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.3 2.3b1 2.3a1 2.3a0 2.2.2"
+# sys.version) below in "best" to "worst" order, not including the
+# target version. Up to six acceptable python versions are allowed.
+# Do not include the target version number in this list!
+ACCEPTABLE="2.2.2 2.3 2.3b1 2.3a1 2.3a0"
# provide the executable names for all the acceptable versions
# (and the target version) below
@@ -60,6 +60,7 @@
IFS=":"
FOUND=""
VERSION=""
+ FOUNDLIST=""
echo "Testing for an acceptable Python interpreter..."
echo
for DIR in $PATH; do
@@ -80,7 +81,19 @@
i=1;
for ACC in $ACCEPTABLE; do
let "i = i + 1"
+ for SLOT in $FOUNDLIST; do
+ if [ $SLOT == $i ]; then
+ # slot "i" already populated. This means we've
+ # already found this particular version of
+ # python. Continue the for ACC in
+ # $ACCEPTABLE loop and don't overwrite the
+ # one we already found (interpreters first
+ # on the path win).
+ continue 2
+ fi
+ done
if [ "$VERSION" = "$ACC" ]; then
+ FOUNDLIST="$FOUNDLIST $i"
eval "FOUND$i=$FULL"
eval "FOUNDVERSION$i=$VERSION"
fi