Commit ca6eb784 authored by Chris McDonough's avatar Chris McDonough

Make --quiet quieter.

parent 877ccdfb
#!/bin/sh
# Zope configure script
# $Id: configure,v 1.7 2003/06/13 15:42:25 chrism Exp $
# $Revision: 1.7 $
# $Id: configure,v 1.8 2003/06/13 16:43:05 chrism Exp $
# $Revision: 1.8 $
#####################################################################
# BEGIN EDITABLE PARAMETERS #
......@@ -32,6 +32,9 @@ EXENAMES="python python2 python2.1 python2.2 python2.3"
# where are we?
HERE=`dirname $0`
# should we be quiet?
QUIET=""
usage()
{
echo
......@@ -61,8 +64,8 @@ get_python() {
FOUND=""
VERSION=""
FOUNDLIST=""
echo "Testing for an acceptable Python interpreter..."
echo
out "Testing for an acceptable Python interpreter..."
out ""
for DIR in $PATH; do
IFS="$OLDIFS"
for EXECUTABLE in $EXENAMES; do
......@@ -72,7 +75,7 @@ get_python() {
# Strip trailing + from version number
CMD="$CMD;a=(a[-1]=='+')and(a[:-1])or(a);print a"
VERSION=`$FULL -c "$CMD"`
echo " Python version $VERSION found at $FULL"
out " Python version $VERSION found at $FULL"
if [ "$VERSION" = "$TARGET" ]; then
FOUND="$FULL"
FOUNDVERSION=$VERSION
......@@ -103,14 +106,14 @@ get_python() {
done
done
if [ "$VERSION" = "$TARGET" ]; then
echo
echo " The optimimum Python version ($TARGET) was found at $FOUND."
out ""
out " The optimimum Python version ($TARGET) was found at $FOUND."
elif [ -z "$FOUND1" ] && [ -z "$FOUND2" ] && [ -z "$FOUND3" ] &&
[ -z "$FOUND4" ] && [ -z "$FOUND5" ] && [ -z "$FOUND6" ] ; then
echo
echo " No suitable Python version found. You should install Python"
echo " version $TARGET before continuing. Versions $ACCEPTABLE"
echo " also work, but not as optimally."
out ""
out " No suitable Python version found. You should install"
out " Python version $TARGET before continuing. Versions"
out " $ACCEPTABLE also work, but not as optimally."
exit 1
else
if [ -n "$FOUND1" ]; then
......@@ -132,17 +135,23 @@ get_python() {
FOUND=$FOUND6
FOUNDVERSION=$FOUNDVERSION6
fi
echo
echo " !! WARNING !! "
echo " An acceptable, but non-optimal Python version ($FOUNDVERSION) "
echo " was found at '$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."
out ""
out " !! WARNING !! "
out " An acceptable, but non-optimal Python version ($FOUNDVERSION) "
out " was found at '$FOUND'."
out " But consider installing version '$TARGET' before running "
out " 'make'. If this isn't the Python version or interpreter "
out " instance you wish to use, you may specify a Python interpreter"
out " manually by rerunning the ./configure script with the "
out " '--with-python' option."
fi
out ""
}
out() {
if [ -z $QUIET ]; then
echo $1
fi
echo
}
NEWOPTS=""
......@@ -160,8 +169,12 @@ for OPT in $@; do
FOUND=`echo $OPT | sed -e 's/--with-python\=//'`
# use eval to do tilde expansion below
eval "FOUND='$FOUND'"
echo
echo "Using Python interpreter at $FOUND"
out ""
out "Using Python interpreter at $FOUND"
;;
--quiet* | -q*)
QUIET="true"
NEWOPTS="$NEWOPTS $OPT"
;;
*)
NEWOPTS="$NEWOPTS $OPT"
......@@ -169,9 +182,9 @@ for OPT in $@; do
esac
done
echo
echo "Configuring Zope installation"
echo
out ""
out "Configuring Zope installation"
out ""
if [ -z "$FOUND" ]; then
get_python
......
......@@ -16,9 +16,10 @@ Create a Makefile for building and installing Zope.
import getopt
import os
import sys
import versions
QUIET=0
if sys.platform == 'win32':
PREFIX = 'c:\\Zope-' + versions.ZOPE_MAJOR_VERSION
IN_MAKEFILE = 'Makefile.win.in'
......@@ -63,13 +64,15 @@ def main():
BUILD_BASE = a
if o == '--quiet':
DISTUTILS_OPTS = '-q'
global QUIET
QUIET = 1
if REQUIRE_LF_ENABLED:
test_largefile()
if REQUIRE_ZLIB:
test_zlib()
print " - Zope top-level binary directory will be %s." % PREFIX
out(" - Zope top-level binary directory will be %s." % PREFIX)
if INSTALL_FLAGS:
print " - Distutils install flags will be '%s'" % INSTALL_FLAGS
out(" - Distutils install flags will be '%s'" % INSTALL_FLAGS)
idata = {
'<<PYTHON>>':PYTHON,
'<<PREFIX>>':PREFIX,
......@@ -85,10 +88,10 @@ def main():
MAKEFILE = MAKEFILE.replace(k, v)
f = open(os.path.join(os.getcwd(), 'makefile'), 'w')
f.write(MAKEFILE)
print " - Makefile written."
print
print " Next, run %s." % MAKE_COMMAND
print
out(" - Makefile written.")
out("")
out(" Next, run %s." % MAKE_COMMAND)
out("")
def usage():
usage = ("""
......@@ -180,5 +183,9 @@ size ever exceeds 2GB.
)
sys.exit(1)
def out(s):
if not QUIET:
print s
if __name__ == '__main__':
main()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment