Commit ca6eb784 authored by Chris McDonough's avatar Chris McDonough

Make --quiet quieter.

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