[Zope-Checkins] SVN: Zope/trunk/ Removed no longer maintained ``configure, make, make install`` related installation files. Zope2 can only be installed via its setup.py.
Hanno Schlichting
hannosch at hannosch.eu
Thu Jul 30 14:31:36 EDT 2009
Log message for revision 102382:
Removed no longer maintained ``configure, make, make install`` related installation files. Zope2 can only be installed via its setup.py.
Changed:
D Zope/trunk/configure
U Zope/trunk/doc/CHANGES.rst
D Zope/trunk/inst/Makefile.in
D Zope/trunk/inst/Makefile.win.in
D Zope/trunk/inst/WinBuilders/
D Zope/trunk/inst/compilezpy.py
D Zope/trunk/inst/configure.py
D Zope/trunk/inst/file_from_infile.py
D Zope/trunk/inst/install.py
D Zope/trunk/inst/make_resource.py
D Zope/trunk/inst/tar.py
D Zope/trunk/inst/versions.py
D Zope/trunk/inst/walkandscrub.py
-=-
Deleted: Zope/trunk/configure
===================================================================
--- Zope/trunk/configure 2009-07-30 18:30:52 UTC (rev 102381)
+++ Zope/trunk/configure 2009-07-30 18:31:36 UTC (rev 102382)
@@ -1,206 +0,0 @@
-#!/bin/sh
-
-# Zope configure script
-# $Id$
-
-#####################################################################
-# BEGIN EDITABLE PARAMETERS #
-#####################################################################
-
-# Place the optimal target version number for Zope (as returned by sys.version)
-# below
-TARGET="2.5.4"
-
-# Order a list of "acceptable" python version numbers (as returned by
-# 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.6.1"
-
-# provide the executable names for all the acceptable versions
-# (and the target version) below
-EXENAMES="python python2 python2.5 python2.6"
-
-#####################################################################
-# END EDITABLE PARAMETERS #
-#####################################################################
-
-# where are we?
-HERE=`dirname $0`
-
-# should we be quiet?
-QUIET=""
-
-usage()
-{
- echo
- echo "configure [--help] [--quiet] [--with-python=path] [--prefix=path] "
- echo " [--build-base=path] [--ignore-largefile] [--ignore-zlib]"
- echo " [--optimize]"
- echo
- echo " Creates a Makefile suitable for building and installing Zope"
- echo
- echo " Options: "
- echo " --help shows usage and quits"
- echo " --quiet suppress nonessential output"
- echo " --with-python specify a path to a Python interpreter to use"
- echo " --prefix specify an installation path for binary data"
- echo " --build-base specify a temporary path for build files"
- echo " --ignore-largefile ignore large file support warnings"
- echo " --ignore-expat ignore warnings about expat/pyexpat"
- echo " --ignore-zlib ignore warnings about zlib"
- echo " --optimize optimize compiled Python bytecode"
- echo " --no-compile Dont compile Python bytecode"
- echo
- echo " Given no options, configure will search your PATH for a suitable"
- echo " Python interpreter and will use '/opt/Zope-<ZOPE_MAJOR_VERSION>'"
- echo " as a prefix."
- echo
-}
-
-# bootstrap ourselves by finding a Python interpreter if necessary
-get_python() {
- OLDIFS="$IFS"
- IFS=":"
- FOUND=""
- VERSION=""
- FOUNDLIST=""
- out "Testing for an acceptable Python interpreter..."
- out ""
- for DIR in $PATH; do
- IFS="$OLDIFS"
- for EXECUTABLE in $EXENAMES; do
- FULL="$DIR/$EXECUTABLE"
- if [ -x "$FULL" -a ! -d "$FULL" ]; then
- CMD="import string,sys;a=string.split(sys.version)[0]"
- # Strip trailing + from version number
- CMD="$CMD;a=(a[-1]=='+')and(a[:-1])or(a);print a"
- VERSION=`"$FULL" -c "$CMD"`
- out " Python version $VERSION found at $FULL"
- if [ "$VERSION" = "$TARGET" ]; then
- FOUND="$FULL"
- FOUNDVERSION=$VERSION
- break 2
- else
- i=1;
- for ACC in $ACCEPTABLE; do
- i=`expr $i + 1`
- for SLOT in $FOUNDLIST; do
- if [ $SLOT -eq $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
- done
- fi
- fi
- done
- done
- if [ "$VERSION" = "$TARGET" ]; then
- out ""
- out " The optimum Python version ($TARGET) was found at $FOUND."
- elif [ -z "$FOUND1" ] && [ -z "$FOUND2" ] && [ -z "$FOUND3" ] &&
- [ -z "$FOUND4" ] && [ -z "$FOUND5" ] && [ -z "$FOUND6" ] ; then
- out ""
- out " No suitable Python version found. You should install"
- out " Python version $TARGET before continuing."
- if [ "$ACCEPTABLE" ]; then
- out " Versions $ACCEPTABLE also work, but not as optimally."
- fi
- exit 1
- 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
- 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
-}
-
-NEWOPTS=""
-
-for OPT in $@; do
- case "$OPT" in
- --h* | -h*)
- usage
- exit 0
- ;;
- --with-python=*)
- # pop this argument from the arglist, it is not valid to
- # pass this along to the Python configurator.
- shift;
- FOUND=`echo $OPT | sed -e 's/--with-python\=//'`
- # use eval to do tilde expansion below
- eval "FOUND='$FOUND'"
- out ""
- out "Using Python interpreter at $FOUND"
- ;;
- --with-python)
- # in case someone passed in a --with-python without a value,
- # we raise an error instead of passing it along to configure.py
- # (which would raise an inscrutable error were it to receive this
- # option).
- out "--with-python argument requires an option"
- exit 1
- ;;
- --quiet* | -q*)
- QUIET="true"
- NEWOPTS="$NEWOPTS $OPT"
- ;;
- *)
- NEWOPTS="$NEWOPTS $OPT"
- ;;
- esac
-done
-
-out ""
-out "Configuring Zope installation"
-out ""
-
-if [ -z "$FOUND" ]; then
- get_python
-fi
-
-# run the Python configurator
-"$FOUND" "$HERE/inst/configure.py" $NEWOPTS
Modified: Zope/trunk/doc/CHANGES.rst
===================================================================
--- Zope/trunk/doc/CHANGES.rst 2009-07-30 18:30:52 UTC (rev 102381)
+++ Zope/trunk/doc/CHANGES.rst 2009-07-30 18:31:36 UTC (rev 102382)
@@ -11,6 +11,9 @@
Restructuring
+++++++++++++
+- Removed no longer maintained ``configure, make, make install`` related
+ installation files. Zope2 can only be installed via its setup.py.
+
- Centralize interfaces defined in Products.ZCTextIndex, leaving BBB
imports behind in old locations.
Deleted: Zope/trunk/inst/Makefile.in
===================================================================
--- Zope/trunk/inst/Makefile.in 2009-07-30 18:30:52 UTC (rev 102381)
+++ Zope/trunk/inst/Makefile.in 2009-07-30 18:31:36 UTC (rev 102382)
@@ -1,157 +0,0 @@
-# Zope2 build and install Makefile.
-
-# We do as much as possible in Python in order to avoid needing to
-# learn autoconf or some other awful thing. ;-)
-
-NAME=Zope
-MAJOR_VERSION=<<ZOPE_MAJOR_VERSION>>
-MINOR_VERSION=<<ZOPE_MINOR_VERSION>>
-RELEASE_TAG=<<VERSION_RELEASE_TAG>>
-PACKAGE_NAME=${NAME}-${MAJOR_VERSION}.${MINOR_VERSION}-${RELEASE_TAG}
-
-PYTHON="<<PYTHON>>"
-TMPDIR=/tmp
-PREFIX=<<PREFIX>>
-BASE_DIR=<<BASE_DIR>>
-BUILD_BASE=<<BUILD_BASE>>
-DISTUTILS_OPTS=<<DISTUTILS_OPTS>>
-INSTALL_FLAGS=<<INSTALL_FLAGS>>
-TESTOPTS=-v
-BUILD_FLAGS=--build-base="${BUILD_BASE}" \
- --build-lib="${BUILD_BASE}/build-lib" \
- --build-scripts="${BUILD_BASE}/build-scripts"\
- --build-temp="${BUILD_BASE}/build-temp"
-
-RM=rm -f
-RMRF=rm -rf
-FIND=find
-GREP=grep
-XARGS=xargs
-CD=cd
-LN=ln -sfn
-CP=cp
-TAR=tar
-MKDIR=mkdir -p
-
-.PHONY : clean install instance untestinst testinst build unbuild
-.PHONY : default
-
-# default: The default step (invoked when make is called without a target)
-default: build
- @echo
- @echo Zope built. Next, do \'make install\' \(or \'make inplace\',
- @echo followed by \'make instance\' to run a Zope instance directly
- @echo from the build directory\).
-
-# build: Do whatever 'setup.py build' implies
-build:
- ${PYTHON} "${BASE_DIR}/setup.py" \
- ${DISTUTILS_OPTS} build ${BUILD_FLAGS}
-
-# unbuild: Remove the build directory (undo the make build step)
-unbuild:
- ${RMRF} ${BUILD_BASE}
-
-# install: Install a software home.
-install: build version_txt
- ${PYTHON} "${BASE_DIR}/setup.py" ${DISTUTILS_OPTS} install \
- --home="${PREFIX}" ${BUILD_FLAGS} ${INSTALL_FLAGS}
- [ -f ${PREFIX}/bin/python ] || ${LN} ${PYTHON} ${PREFIX}/bin/python
- @echo
- @echo Zope binaries installed successfully.
- @echo Now run \'${PREFIX}/bin/mkzopeinstance.py\'
-
-# inplace: Install a software home into to the source directory.
-#
-# Note: We used to run 'build_ext -i' for 'inplace', but that was
-# suboptimal because it had a tendency to try to rebuild all of the
-# (possibly already-built) extensions that might be built during a
-# previous 'make' step. built_ext doesn't understand '--build-base'
-# and friends so we can't stop it from doing this easily. So instead,
-# we rely on the stock install step and name the prefix as the current
-# directory. This is a little less efficient than just building the
-# extensions because it also compiles bytecode, but it's more intuitive and
-# less expensive in the common case than letting distutils
-# potentially rebuild the binaries when we've done that already.
-inplace: PREFIX=${BASE_DIR}
-inplace: install
-
-# test: Do an inplace build and run the Zope test suite.
-test: inplace
- ${PYTHON} "${BASE_DIR}/test.py" ${TESTOPTS}
-
-# instance: Do an inplace build and create an instance home in the resulting
-# software home.
-instance: build
- ${PYTHON} "${BASE_DIR}/utilities/mkzopeinstance.py" ${MKZ_FLAGS}
-
-# testinst: Perform an inplace build and create an instance home in the
-# resulting software home without asking questions. Useful when
-# performing automated testing.
-testinst: MKZ_FLAGS=--user=admin:admin --dir="${BASE_DIR}"
-testinst: instance
-
-# uninstance: Remove the instance files made by testinstance (w/ prejudice)
-uninstance:
- ${RMRF} "${BASE_DIR}/etc"
- ${RMRF} "${BASE_DIR}/import"
- ${RMRF} "${BASE_DIR}/log"
- ${RMRF} "${BASE_DIR}/var"
- ${RMRF} "${BASE_DIR}/Products"
-
-# clean: Delete the build files and any binaries/bytecode files in
-# the source directory for good measure.
-clean: unbuild
- ${FIND} "${BASE_DIR}" \
- -name '*.py[co]' -o -name '*.so' -o -name '*.o' | \
- grep -vE "${BASE_DIR}/src|${BASE_DIR}/parts|${BASE_DIR}/eggs|${BASE_DIR}/develop" | \
- ${XARGS} ${RM}
- ${RM} "$(BASE_DIR)/lib/python/Zope2/version.txt"
- ${RMRF} build
-
-# version_txt: create a version file in lib/python/version.txt
-version_txt:
- printf "Zope ${MAJOR_VERSION}.${MINOR_VERSION}-${RELEASE_TAG}" >\
- "${BASE_DIR}/lib/python/Zope2/version.txt"
-
-sdist: clean sdist_tgz
-
-# sdist_tgz: Create a tgz archive file as a source distribution.
-#
-sdist_tgz: version_txt
- ${FIND} . -type f -exec chmod a+r {} \;
- ${FIND} . -type d -exec chmod a+rx {} \;
- ${MKDIR} ${TMPDIR}
- ${CD} ${TMPDIR} && ${LN} ${BASE_DIR} ${PACKAGE_NAME} && \
- ${TAR} czfh ${BASE_DIR}/${PACKAGE_NAME}.tgz \
- --exclude=${PACKAGE_NAME}.tgz\
- --exclude=.svn\
- --exclude=${PACKAGE_NAME}/.installed.cfg \
- --exclude=.DS_Store \
- --exclude=${PACKAGE_NAME}/bin \
- --exclude=${PACKAGE_NAME}/etc \
- --exclude=${PACKAGE_NAME}/import \
- --exclude=${PACKAGE_NAME}/log \
- --exclude=${PACKAGE_NAME}/var \
- --exclude=${PACKAGE_NAME}/Products \
- --exclude=${PACKAGE_NAME}/makefile \
- --exclude=${PACKAGE_NAME}/build-base \
- --exclude=${PACKAGE_NAME}/bootstrap \
- --exclude=${PACKAGE_NAME}/develop-eggs \
- --exclude=${PACKAGE_NAME}/develop \
- --exclude=${PACKAGE_NAME}/eggs \
- --exclude=${PACKAGE_NAME}/include \
- --exclude=${PACKAGE_NAME}/parts \
- --exclude=${PACKAGE_NAME}/src \
- --exclude=${PACKAGE_NAME}/*.cfg \
- --exclude=*~ \
- --exclude=.#* ${PACKAGE_NAME}
- ${RMRF} ${TMPDIR}/${PACKAGE_NAME}
-
-# clobber: Make the source tree 'pristine' again.
-clobber: clean uninstance
-
-# distclean: Make the source tree *really* 'pristine' again.
-distclean: clobber
- ${RM} makefile Makefile
- ${RMRF} build-base
Deleted: Zope/trunk/inst/Makefile.win.in
===================================================================
--- Zope/trunk/inst/Makefile.win.in 2009-07-30 18:30:52 UTC (rev 102381)
+++ Zope/trunk/inst/Makefile.win.in 2009-07-30 18:31:36 UTC (rev 102382)
@@ -1,133 +0,0 @@
-# Zope2 build and install Makefile for win32 (nmake-style).
-
-# We do as much as possible in Python in order to avoid needing to
-# learn autoconf or some other awful thing. ;-)
-
-NAME=Zope
-MAJOR_VERSION=<<ZOPE_MAJOR_VERSION>>
-MINOR_VERSION=<<ZOPE_MINOR_VERSION>>
-RELEASE_TAG=<<VERSION_RELEASE_TAG>>
-ZOPEVERSION=$(MAJOR_VERSION).$(MINOR_VERSION)-$(RELEASE_TAG)
-PACKAGE_NAME=$(NAME)-$(ZOPEVERSION)
-
-PYTHON="<<PYTHON>>"
-TMPDIR="<<TMP_DIR>>"
-PREFIX="<<PREFIX>>"
-BASE_DIR=<<BASE_DIR>>
-BUILD_BASE=<<BUILD_BASE>>
-DISTUTILS_OPTS=<<DISTUTILS_OPTS>>
-INSTALL_FLAGS=<<INSTALL_FLAGS>>
-TESTOPTS=-v
-BUILD_FLAGS=--build-base="$(BUILD_BASE)" \
- --build-lib="$(BUILD_BASE)\build-lib" \
- --build-scripts="$(BUILD_BASE)\build-scripts" \
- --build-temp="$(BUILD_BASE)\build-temp"
-
-RM=del /f /q
-!IF ("$(OS)" == "Windows_NT")
-RMRF=rmdir /s /q
-!ELSE
-RMRF=deltree /y
-!ENDIF
-CD=cd
-XCOPY=xcopy /i /s /e /y
-COPY=copy
-MOVE=move
-EXISTS=IF EXIST
-NOT_EXISTS=IF NOT EXIST
-
-default: build
-# default: The default step (invoked when make is called without a target)
- @ echo.
- @ echo Zope built. Next, do 'nmake install'.
- @ echo.
-
-.PHONY : clean install instance untestinst testinst build unbuild
-.PHONY : default
-
-# build: Do whatever 'setup.py build' implies
-build:
- $(PYTHON) "$(BASE_DIR)\setup.py" \
- $(DISTUTILS_OPTS) build $(BUILD_FLAGS)
-
-# unbuild: Remove the build directory (undo the make build step)
-unbuild:
- -$(EXISTS) $(BUILD_BASE) $(RMRF) $(BUILD_BASE)
-
-# install: Install a software home.
-install: build version_txt
- $(PYTHON) "$(BASE_DIR)\setup.py" $(DISTUTILS_OPTS) install \
- --prefix="$(PREFIX)" $(BUILD_FLAGS) $(INSTALL_FLAGS)
- @ echo.
- @ echo Zope binaries installed successfully.
- @ echo Now run '$(PYTHON) $(PREFIX)\bin\mkzopeinstance.py'
-
-
-$(BASE_DIR)/inst/tmp/$(PACKAGE_NAME).tgz:
- $(MAKE) sdist
- $(NOT_EXISTS) inst\tmp $(MKDIR) inst\tmp
- $(MOVE) $(PACKAGE_NAME).tgz inst\tmp
-
-# installer: Create the Zope Installer.
-installer: $(BASE_DIR)/inst/tmp/$(PACKAGE_NAME).tgz
- $(CD) inst && sh Winbuilders/buildout zope ZOPEVERSION=$(ZOPEVERSION)
-
-# inplace: Do an in-place build
-inplace:
- $(MAKE) install PREFIX="$(BASE_DIR)"
-
-# test: Do an inplace build and run the Zope test suite.
-test: inplace
- $(PYTHON) "$(BASE_DIR)\test.py" $(TESTOPTS)
-
-# instance: Do an inplace build and create an instance home in the resulting
-# software home.
-instance: build
- $(PYTHON) "$(BASE_DIR)\utilities\mkzopeinstance.py" $(MKZ_FLAGS)
-
-# testinst: Perform an inplace build and create an instance home in the
-# resulting software home without asking questions. Useful when
-# performing automated testing.
-testinst:
- $(MAKE) instance MKZ_FLAGS=--user=admin:admin --dir="$(BASE_DIR)"
-
-# uninstance: Remove the instance files made by testinstance (w/ prejudice)
-uninstance:
- $(EXISTS) "$(BASE_DIR)/bin" $(RMRF) "$(BASE_DIR)/bin"
- $(EXISTS) "$(BASE_DIR)/etc" $(RMRF) "$(BASE_DIR)/etc"
- $(EXISTS) "$(BASE_DIR)/import" $(RMRF) "$(BASE_DIR)/import"
- $(EXISTS) "$(BASE_DIR)/log" $(RMRF) "$(BASE_DIR)/log"
- $(EXISTS) "$(BASE_DIR)/var" $(RMRF) "$(BASE_DIR)/var"
- $(EXISTS) "$(BASE_DIR)/Products" $(RMRF) "$(BASE_DIR)/Products"
-
-# clean: Delete the build files and any binaries/bytecode files in
-# the source directory for good measure.
-clean:
- $(CD) "$(BASE_DIR)"
- -$(RM) /s *.pyc *.pyo *.dll *.o *.obj *.pyd
- -$(EXISTS) "$(BASE_DIR)\lib\python\Zope2\version.txt" $(RM) "$(BASE_DIR)\lib\python\Zope2\version.txt"
- -$(EXISTS) build $(RMRF) build
-
-# version_txt: create a version file in lib/python/Zope2/version.txt
-version_txt:
- echo Zope $(MAJOR_VERSION).$(MINOR_VERSION)-$(RELEASE_TAG) > \
- "$(BASE_DIR)/lib/python/Zope2/version.txt"
-
-# sdist: Create a source distribution file (implies clobber).
-#
-sdist: clobber sdist_tgz
-
-# sdist_tgz: Create a tgz archive file as a source distribution.
-#
-sdist_tgz: version_txt
- $(PYTHON) $(BASE_DIR)\inst\tar.py $(BASE_DIR)\$(PACKAGE_NAME).tgz $(BASE_DIR)
-
-# clobber: Make the source tree 'pristine' again.
-clobber: clean uninstance
-
-# distclean: Make the source tree *really* 'pristine' again.
-distclean: clobber
- $(EXISTS) makefile $(RM) makefile
- $(EXISTS) Makefile $(RM) Makefile
- $(EXISTS) build-base $(RMRF) build-base
-
Deleted: Zope/trunk/inst/compilezpy.py
===================================================================
--- Zope/trunk/inst/compilezpy.py 2009-07-30 18:30:52 UTC (rev 102381)
+++ Zope/trunk/inst/compilezpy.py 2009-07-30 18:31:36 UTC (rev 102382)
@@ -1,68 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2002 Zope Corporation and Contributors. All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE
-#
-##############################################################################
-
-import compileall, os, sys
-
-class Shutup:
- def write(*args): pass # :)
-
-class NoteErr:
- wrote = 0
- def write(self, *args):
- self.wrote = 1
- apply(stderr.write, args)
-
-def compile_non_test(dir):
- """Byte-compile all modules except those in test directories."""
- success = compileall.compile_dir(dir, maxlevels=0)
- try:
- names = os.listdir(dir)
- except os.error:
- print "Can't list", dir
- names = []
- names.sort()
- for name in names:
- fullname = os.path.join(dir, name)
- if (name != os.curdir and name != os.pardir and
- os.path.isdir(fullname) and not os.path.islink(fullname) and
- name != 'test' and name != 'tests' and name != 'skins'):
- success = success and compile_non_test(fullname)
- return success
-
-print
-print '-'*78
-print 'Compiling python modules'
-stdout = sys.stdout
-stderr = sys.stderr
-try:
- try:
- success = 0
- sys.stdout = Shutup()
- sys.stderr = NoteErr()
- success = compile_non_test(os.getcwd())
- finally:
- success = success and not sys.stderr.wrote
- sys.stdout = stdout
- sys.stderr = stderr
-except:
- success = 0
- import traceback
- traceback.print_exc()
-
-if not success:
- print
- print '!' * 78
- print 'There were errors during Python module compilation.'
- print '!' * 78
- print
- sys.exit(1)
Deleted: Zope/trunk/inst/configure.py
===================================================================
--- Zope/trunk/inst/configure.py 2009-07-30 18:30:52 UTC (rev 102381)
+++ Zope/trunk/inst/configure.py 2009-07-30 18:31:36 UTC (rev 102382)
@@ -1,238 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2002 Zope Corporation and Contributors. All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE
-#
-##############################################################################
-"""
-Create a Makefile for building and installing Zope.
-"""
-import getopt
-import os
-import sys
-import versions
-import tempfile
-
-QUIET=0
-
-if sys.platform == 'win32':
- PREFIX = 'c:\\Zope-' + versions.ZOPE_MAJOR_VERSION
- IN_MAKEFILE = 'Makefile.win.in'
- MAKE_COMMAND='the Visual C++ batch file "VCVARS32.bat" and then "nmake"'
-else:
- PREFIX = '/opt/Zope-' + versions.ZOPE_MAJOR_VERSION
- IN_MAKEFILE = 'Makefile.in'
- MAKE_COMMAND='make'
-
-def main():
- # below assumes this script is in the BASE_DIR/inst directory
- global PREFIX
- BASE_DIR=os.path.abspath(os.path.dirname(os.path.dirname(sys.argv[0])))
- BUILD_BASE=os.path.join(os.getcwd(), 'build-base',
- 'python-%s.%s' % sys.version_info[:2])
- PYTHON=sys.executable
- TMP_DIR = tempfile.gettempdir()
- MAKEFILE=open(os.path.join(BASE_DIR, 'inst', IN_MAKEFILE)).read()
- REQUIRE_LF_ENABLED = 1
- REQUIRE_ZLIB = 1
- REQUIRE_EXPAT = 1
- INSTALL_FLAGS = ''
- DISTUTILS_OPTS = ''
- try:
- longopts = ['help', 'ignore-largefile', 'ignore-zlib',
- 'ignore-expat', 'prefix=',
- 'build-base=', 'optimize', 'no-compile', 'quiet']
- opts, args = getopt.getopt(sys.argv[1:], 'h', longopts)
- except getopt.GetoptError, v:
- print v
- usage()
- sys.exit(1)
- for o, a in opts:
- if o in ('-h', '--help'):
- usage()
- sys.exit()
- if o == '--prefix':
- PREFIX=os.path.abspath(os.path.expanduser(a))
- if o == '--ignore-largefile':
- REQUIRE_LF_ENABLED=0
- if o == '--ignore-zlib':
- REQUIRE_ZLIB=0
- if o == '--ignore-expat':
- REQUIRE_EXPAT=0
- if o == '--optimize':
- INSTALL_FLAGS = '--optimize=1 --no-compile'
- if o == '--no-compile':
- INSTALL_FLAGS = '--no-compile'
- if o == '--build-base':
- BUILD_BASE = a
- if o == '--quiet':
- DISTUTILS_OPTS = '-q'
- global QUIET
- QUIET = 1
- if REQUIRE_LF_ENABLED:
- test_largefile()
- if REQUIRE_ZLIB:
- test_zlib()
- if REQUIRE_EXPAT:
- test_expat()
- out(' - Zope top-level binary directory will be %s.' % PREFIX)
- if INSTALL_FLAGS:
- out(' - Distutils install flags will be "%s"' % INSTALL_FLAGS)
- idata = {
- '<<PYTHON>>':PYTHON,
- '<<PREFIX>>':PREFIX,
- '<<BASE_DIR>>':BASE_DIR,
- '<<BUILD_BASE>>':BUILD_BASE,
- '<<TMP_DIR>>':TMP_DIR,
- '<<INSTALL_FLAGS>>':INSTALL_FLAGS,
- '<<ZOPE_MAJOR_VERSION>>':versions.ZOPE_MAJOR_VERSION,
- '<<ZOPE_MINOR_VERSION>>':versions.ZOPE_MINOR_VERSION,
- '<<VERSION_RELEASE_TAG>>':versions.VERSION_RELEASE_TAG,
- '<<DISTUTILS_OPTS>>':DISTUTILS_OPTS,
- }
- for k,v in idata.items():
- MAKEFILE = MAKEFILE.replace(k, v)
- f = open(os.path.join(os.getcwd(), 'makefile'), 'w')
- f.write(MAKEFILE)
- out(' - Makefile written.')
- out('')
- out(' Next, run %s.' % MAKE_COMMAND)
- out('')
-
-def usage():
- usage = ("""
-%(program)s configures and writes a Makefile for Zope.
-
-Defaults for options are specified in brackets.
-
-Configuration:
-
- -h, --help display this help and exit
-
-Options:
-
- --quiet suppress nonessential output
-
- --ignore-zlib allow configuration to proceeed if
- Python zlib module is not found.
-
- --ignore-largefile allow configuration to proceed without
- Python large file support.
-
- --ignore-expat allow configuration to proceed if the expat
- XML parsing module is not found.
-
- --optimize compile Python files as .pyo files
- instead of as .pyc files
-
- --no-compile don't compile Python files
-
-Directories:
-
- --build-base=DIR use DIR to store temporary build files
-
- --prefix=DIR install Zope files in DIR [%(PREFIX)s]
-
-By default, 'make install' will install Zope software files in
-'%(PREFIX)s' You can specify an alternate location for these
-files by using '--prefix', for example: '--prefix=$HOME/zope'.
-""" % ({'program':sys.argv[0], 'PREFIX':PREFIX})
- )
- print usage
-
-def test_expat():
- try:
- import xml.parsers.expat
- except ImportError:
- print (
- """
-The Python interpreter you are using does not appear to have the 'pyexpat'
-library module installed. For many Zope features to work properly, including
-Zope Page Templates, you must install a Python interpreter which includes the
-pyexpat module, or install the pyexpat library into your Python interpreter
-manually. The file which represents the library is named 'pyexpat.so' (UNIX)
-or 'pyexpat.dll' (Windows) and is typically located in the 'lib-dynload'
-directory of your Python's library directory. Some Python packagers ship the
-pyexpat module as a separate installable binary. If you are using a
-system-provided Python installation, you may want to look for a 'python-xml'
-or 'python-pyexpat' package (or something like it) and install it to make the
-pyexpat module available to Zope. If you've compiled your Python interpreter
-from source, you may need to recompile and reinstall it after installing James
-Clark's expat libraries and development packages (look for libexpat.so and
-expat.h). Typically, these come as part of your operating system's libexpat
-and libexpat-dev packages, respectively.
-
-Run the configure script with the --ignore-expat option to prevent this
-warning with the understanding that some Zope features may not work properly
-until you've installed the pyexpat module.
-"""
- )
- sys.exit(1)
-
-
-def test_zlib():
- try:
- import zlib
- except ImportError:
- print (
- """
-The Python interpreter you are using does not appear to have the 'zlib'
-library module installed. For Zope to be able to run, you must install a
-Python interpreter which includes the zlib module, or install the zlib library
-into your Python interpreter manually. The file which represents the library
-is named 'zlib.so' (UNIX) or 'zlib.dll' (Windows) and is typically located in
-the 'lib-dynload' directory of your Python's library directory. Some
-Python packagers ship the zlib module as a separate installable binary. If you
-are using a system-provided Python installation, you may want to look for
-a 'python-zlib' package (or something like it) and install it to make the
-Python zlib module available to Zope.
-
-Run the configure script with the --ignore-zlib option to prevent this
-warning with the understanding that Zope will not start properly until
-you've installed the zlib module.
-"""
- )
- sys.exit(1)
- except:
- print 'An error occurred while trying to import zlib!'
- import traceback; traceback.print_exc()
- sys.exit(1)
-
-def test_largefile():
- OK=0
- f = open(sys.argv[0], 'r')
- try:
- # 2**31 == 2147483648
- f.seek(2147483649L)
- f.close()
- OK=1
- except (IOError, OverflowError):
- f.close()
- if OK:
- return
- print (
- """
-This Python interpreter does not have 'large file support' enabled. Large
-file support is required to allow the default Zope ZODB database to grow
-larger than 2GB on most platforms. Either install a Python interpreter with
-large file support (see
-http://www.python.org/doc/current/lib/posix-large-files.html) or run this
-program again with the --ignore-largefile option to prevent this warning,
-with the understanding that your Zope may fail if the ZODB database
-size ever exceeds 2GB.
-"""
- )
- sys.exit(1)
-
-def out(s):
- if not QUIET:
- print s
-
-if __name__ == '__main__':
- main()
Deleted: Zope/trunk/inst/file_from_infile.py
===================================================================
--- Zope/trunk/inst/file_from_infile.py 2009-07-30 18:30:52 UTC (rev 102381)
+++ Zope/trunk/inst/file_from_infile.py 2009-07-30 18:31:36 UTC (rev 102382)
@@ -1,90 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2002 Zope Corporation and Contributors. All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE
-#
-##############################################################################
-"""
-Reads a file named by 'src', performs textual replacements on the
-file based on sed-style markup, and writes the result to the file named
-by 'dst' unless 'dst' already exists.
-"""
-import getopt, os, sys
-from os.path import abspath, split, dirname
-import shutil
-import versions
-
-default_map = {
- 'PYTHON' : sys.executable,
- 'BASE_DIR' : abspath(split(dirname(sys.argv[0]))[0]),
- 'ZOPE_MAJOR_VERSION' : versions.ZOPE_MAJOR_VERSION,
- 'ZOPE_MINOR_VERSION' : versions.ZOPE_MINOR_VERSION,
- 'ZOPE_BRANCH_NAME' : versions.ZOPE_BRANCH_NAME,
- 'VERSION_RELEASE_TAG' : versions.VERSION_RELEASE_TAG,
- }
-
-def main(source, dest, map, force):
- if not force and os.path.exists(dest):
- print '%s exists, so I left it alone' % dest
- else:
- txt = open(source, 'rb').read()
- for k, v in map.items():
- txt = txt.replace('<<%s>>' % k, v)
- outfile = open(dest, 'wb')
- outfile.write(txt)
- outfile.close()
- shutil.copystat(source, dest)
- print "Wrote %s from %s" % (dest, source)
-
-def usage():
- print "%s [opts] src dst" % sys.argv[0]
- print
- print "Reads a file named by 'src', performs textual replacements on "
- print "the file based on sed-style markup embedded in the infile, and "
- print "and writes the result to the file named by 'dst' unless 'dst'."
- print "already exists. The generated file will have the same permissions"
- print "and other mode bit settings as the source file."
- print
- print "Options:"
- print
- print " --force Force replacement of dst even if it already exists."
- for name, value in default_map.items():
- print (" --%s=value controls text replacement, default '%s'"
- % (name, value))
-
-if __name__ == '__main__':
- if len(sys.argv) < 3:
- usage()
- sys.exit(127)
- map = default_map.copy()
- force = 0
- try:
- longopts = ['help', 'force']
- for name in default_map.keys():
- longopts.append('%s=' % name)
- opts, args = getopt.getopt(sys.argv[1:], 'h', longopts)
- except getopt.GetoptError, v:
- print v
- usage()
- sys.exit(1)
- try:
- source, dest = args
- except:
- usage()
- sys.exit(1)
- for o, a in opts:
- if o in ('-h', '--help'):
- usage()
- sys.exit()
- if o == '--force':
- force = 1
- if o in map.keys():
- map[o] = a
- main(source, dest, map, force)
-
Deleted: Zope/trunk/inst/install.py
===================================================================
--- Zope/trunk/inst/install.py 2009-07-30 18:30:52 UTC (rev 102381)
+++ Zope/trunk/inst/install.py 2009-07-30 18:31:36 UTC (rev 102382)
@@ -1,167 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2002 Zope Corporation and Contributors. All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE
-#
-##############################################################################
-"""
-Generic file and directory installer.
-
-Typically called when installing Zope via the Makefile written by
-'configure.py' in the 'make install' step.
-"""
-import getopt
-import os
-import re
-import shutil
-import stat
-import sys
-
-# RE that, if a pathname's base name matches, causes it to be ignored
-# when copying that file or directory.
-default_omitpattern = r'(\..*|CVS|.*~)$'
-
-def main(src, dst, dirmode=0755, fmode=0644,
- omitpattern=default_omitpattern, retain_xbit=1):
- """
- Copy a file or directory named by src to a file or directory named by
- dst, normalizing mode bit settings as necessary. Recursively copies
- directory trees using shutil.copy2().
-
- Errors are reported to standard output.
-
- - 'dirmode' is the directory creation mode. All directories
- are created with this mode.
- - 'fmode' is the default file creation mode. This mode
- is modified by the status of the source file. If the source
- file is executable, mod the fmode to be +wgo executable.
- - omitpattern is a Python-style regex pattern. If a file
- or directory name matches this pattern, it will never be copied.
- - if the dst directory already exists, don't raise an error.
- """
- try:
- if os.path.isdir(src):
- copydir(src, dst, dirmode, fmode, omitpattern,
- retain_xbit)
- else:
- names = omit([src], omitpattern)
- names and copyfile(names[0], dst, fmode, retain_xbit)
-
- except (IOError, os.error), why:
- print "Can't copy %s to %s: %s" % (`src`, `dst`, str(why))
-
-def copydir(src, dst, dirmode, fmode, omitpattern, retain_xbit):
- names = omit(os.listdir(src), omitpattern)
- try:
- # always create directories with dirmode
- os.makedirs(dst, dirmode)
- except os.error, why:
- if why[0] == 17:
- # directory already exists
- pass
- else:
- raise
- for name in omit(names, omitpattern):
- srcname = os.path.join(src, name)
- dstname = os.path.join(dst, name)
- if os.path.isdir(srcname):
- copydir(srcname, dstname, dirmode,fmode,omitpattern,
- retain_xbit)
- else:
- copyfile(srcname, dstname, fmode, retain_xbit)
-
-def copylink(src, dst):
- linkto = os.readlink(src)
- os.symlink(linkto, dst)
-
-def copyfile(src, dst, mode, retain_xbit):
- shutil.copy2(src, dst)
- # change dest file mode to fmode but
- # make +wgo executable if source file is executable
- dstmode = mode
- st = os.stat(src)
- srcmode = st[stat.ST_MODE]
- if retain_xbit and (srcmode & stat.S_IEXEC):
- dstmode = (mode | 0111)
- if os.path.isdir(dst):
- # if dst is a directory, copy the file in to it
- os.chmod(os.path.join(dst, os.path.split(src)[-1]), dstmode)
- else:
- os.chmod(dst, dstmode)
-
-omitcache = {}
-
-def omit(names, omitpattern):
- return [ n for n in names
- if not re.match(omitpattern, os.path.basename(n)) ]
-
-def usage():
- print "%s [opts] source dest" % sys.argv[0]
- print
- print "Copies a file or directory specified by 'source' to 'dest'"
- print "normalizing mode bit settings as necessary."
- print
- print "If src is a file and dst is a directory, the file will be"
- print "copied into the dst directory. However, if src is a directory"
- print "and dst is a directory, the contents of src will be copied into"
- print "dst."
- print
- print "opts: --dirmode=mode --fmode=mode --omitpattern=patt"
- print
- print " --dontcopyxbit when copying a file marked as executable,"
- print " don't make the copy executable."
- print " --dirmode mode bit settings of dest dirs (e.g. '755')"
- print " --fmode mode bit settings of dest files (e.g. '644')"
- print " (modified wgo+x when dontcopyxbit is not"
- print " specified)"
- print " --omitpattern a Python-style regex pattern. File and"
- print " directory names which match this pattern will "
- print " not be copied. The default omitpattern is"
- print " '%s'" % default_omitpattern
-
-if __name__ == '__main__':
- if len(sys.argv) < 3:
- print "too few arguments"
- usage()
- sys.exit(2)
- dirmode = 0755
- fmode = 0644
- omitpattern = default_omitpattern
- retain_xbit = 1
- longopts = ['dirmode=', 'fmode=', 'omitpattern=', 'help',
- 'copyxmode' ]
- try:
- opts, args = getopt.getopt(sys.argv[1:], 'h', longopts)
- except getopt.GetoptError, v:
- print v
- usage()
- sys.exit(2)
- try:
- source, dest = args
- except:
- print "wrong number of arguments"
- usage()
- sys.exit(2)
- for o, a in opts:
- if o in ('-h', '--help'):
- usage()
- sys.exit()
- if o == '--dirmode':
- if not a.startswith('0'):
- a = '0%s' % a
- dirmode = eval(a)
- if o == '--fmode':
- if not a.startswith('0'):
- a = '0%s' % a
- fmode = eval(a)
- if o == '--omitpattern':
- omitpattern = a
- if o == '--dontcopyxbit':
- retain_xbit = 0
- main(source, dest, dirmode, fmode, omitpattern, retain_xbit)
Deleted: Zope/trunk/inst/make_resource.py
===================================================================
--- Zope/trunk/inst/make_resource.py 2009-07-30 18:30:52 UTC (rev 102381)
+++ Zope/trunk/inst/make_resource.py 2009-07-30 18:31:36 UTC (rev 102382)
@@ -1,41 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2002 Zope Corporation and Contributors. All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE
-#
-##############################################################################
-"""Build a PCGI resource file.
-
-You must be in the directory containing this script.
-"""
-
-import os
-from do import *
-
-def main(cwd=os.getcwd(), name='Zope', user='', group=''):
- python=sys.executable
- print '-'*78
- print 'Writing the pcgi resource file (ie cgi script), %s' % name
- cwd=os.environ.get('ZDIR',cwd)
-
- open(name,'w').write('''#!%(cwd)s/pcgi/pcgi-wrapper
-PCGI_NAME=Zope
-PCGI_MODULE_PATH=%(cwd)s/lib/python/Zope
-PCGI_PUBLISHER=%(cwd)s/pcgi/pcgi_publisher.py
-PCGI_EXE=%(python)s
-PCGI_SOCKET_FILE=%(cwd)s/var/pcgi.soc
-PCGI_PID_FILE=%(cwd)s/var/pcgi.pid
-PCGI_ERROR_LOG=%(cwd)s/var/pcgi.log
-PCGI_DISPLAY_ERRORS=1
-BOBO_REALM=%(name)s
-BOBO_DEBUG_MODE=1
-INSTANCE_HOME=%(cwd)s
-''' % vars())
-
- ch(name, user, group, 0755)
Deleted: Zope/trunk/inst/tar.py
===================================================================
--- Zope/trunk/inst/tar.py 2009-07-30 18:30:52 UTC (rev 102381)
+++ Zope/trunk/inst/tar.py 2009-07-30 18:31:36 UTC (rev 102382)
@@ -1,74 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2002 Zope Corporation and Contributors. All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE
-#
-##############################################################################
-
-import os
-import sys
-import optparse
-import tarfile
-from distutils import filelist
-
-INCLUDES = tuple('.*'.split())
-EXCLUDES = tuple(r""".*.svn\\ .*CVS\\ .*.tgz
- .*makefile$ .*Makefile$
- .*inst\\tmp\\.* .*inst\\src\\.*
- .*build-base\\ .*build\\
- .*~ .*.#.*""".split())
-
-def collect(top_dir, includes=INCLUDES, excludes=EXCLUDES):
- old_dir = os.getcwd()
- os.chdir(top_dir)
- try:
- fl = filelist.FileList()
- fl.findall()
-
- for inc in includes:
- fl.include_pattern(inc, is_regex=1)
-
- for exc in excludes:
- fl.exclude_pattern(exc, is_regex=1)
-
- return fl.files
- finally:
- os.chdir(old_dir)
-
-def tar_it_up(dest, files):
- tar = tarfile.open(dest, mode='w:gz')
- basename = os.path.splitext(os.path.basename(dest))[0]
- for fname in files:
- tar.add(fname, os.path.join(basename, fname), recursive=False)
- tar.close()
-
-def main(options, args):
- dest, top_dir = args
- includes = options.include
- excludes = options.exclude
- excludes.append('.*%s.*' % os.path.basename(dest))
-
- files = collect(top_dir, includes=includes, excludes=excludes)
- tar_it_up(dest, files)
-
-if __name__ == '__main__':
- excludes = list(EXCLUDES)
- includes = list(INCLUDES)
-
- parser = optparse.OptionParser()
- parser.add_option('', '--exclude', action='append', default=excludes)
- parser.add_option('', '--include', action='append', default=includes)
-
- options, args = parser.parse_args()
-
- if not len(args) == 2:
- parser.print_help()
- parser.exit(status=1)
-
- main(options, args)
Deleted: Zope/trunk/inst/versions.py
===================================================================
--- Zope/trunk/inst/versions.py 2009-07-30 18:30:52 UTC (rev 102381)
+++ Zope/trunk/inst/versions.py 2009-07-30 18:31:36 UTC (rev 102382)
@@ -1,7 +0,0 @@
-ZOPE_MAJOR_VERSION = '2.13'
-ZOPE_MINOR_VERSION = '0'
-ZOPE_BRANCH_NAME = '$Name$'[6:] or 'no-branch'
-
-# always start prerelease branches with '0' to avoid upgrade
-# issues in RPMs
-VERSION_RELEASE_TAG = '0.dev'
Deleted: Zope/trunk/inst/walkandscrub.py
===================================================================
--- Zope/trunk/inst/walkandscrub.py 2009-07-30 18:30:52 UTC (rev 102381)
+++ Zope/trunk/inst/walkandscrub.py 2009-07-30 18:31:36 UTC (rev 102382)
@@ -1,47 +0,0 @@
-##############################################################################
-#
-# Copyright (c) 2002 Zope Corporation and Contributors. All Rights Reserved.
-#
-# This software is subject to the provisions of the Zope Public License,
-# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
-# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
-# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE
-#
-##############################################################################
-
-import os, sys
-DEBUG = 0
-if os.name in ('posix', 'nt', 'dos'):
- EXCLUDED_NAMES=['..', '.']
-else:
- EXCLUDED_NAMES=[]
-
-# extend EXCLUDED_NAMES here manually with filenames ala "asyncore.pyc" for
-# files that are only distributed in compiled format (.pyc, .pyo)
-# if necessary (not currently necessary in 2.3.1 AFAIK) - chrism
-
-def walkandscrub(path):
- path = os.path.expandvars(os.path.expanduser(path))
- print
- print '-'*78
- sys.stdout.write(
- "Deleting '.pyc' and '.pyo' files recursively under %s...\n" % path
- )
- os.path.walk(path, scrub, [])
- sys.stdout.write('Done.\n')
-
-def scrub(list, dirname, filelist):
- for name in filelist:
- if name in EXCLUDED_NAMES:
- continue
- prefix, ext = os.path.splitext(name)
- if ext == '.pyo' or ext == '.pyc':
- full = os.path.join(dirname, name)
- os.unlink(full)
- if DEBUG: print full
-
-if __name__ == '__main__':
- DEBUG = 1
- walkandscrub(os.getcwd())
More information about the Zope-Checkins
mailing list