Commit 79c68527 authored by Matt Behrens's avatar Matt Behrens

disable install unless given a destination directory, to allay fears of

people destroying their site-packages directories; this should hold us
until the installer is done and merged... hopefully in 2.7...

also detabify (I should do this more often)
parent 52d70e30
......@@ -64,8 +64,9 @@ def setup(name=None, author=None, cmdclass=None, **kwargs):
# globbing on data_files.
from types import StringType
from distutils.command.install import install
from distutils.command.install_data import install_data
from distutils.errors import DistutilsFileError
from distutils.errors import DistutilsFileError, DistutilsOptionError
from distutils.util import convert_path
from glob import glob
......@@ -115,6 +116,37 @@ class install_data(install_data):
(out, _) = self.copy_file(g, dir)
self.outfiles.append(out)
class install(install):
def finalize_unix (self):
if self.install_base is not None or self.install_platbase is not None:
if ((self.install_lib is None and
self.install_purelib is None and
self.install_platlib is None) or
self.install_headers is None or
self.install_scripts is None or
self.install_data is None):
raise DistutilsOptionError, \
"install-base or install-platbase supplied, but " + \
"installation scheme is incomplete"
return
if self.home is not None:
self.install_base = self.install_platbase = self.home
self.select_scheme("unix_home")
else:
if self.prefix is None:
if self.exec_prefix is not None:
raise DistutilsOptionError, \
"must not supply exec-prefix without prefix"
raise DistutilsOptionError, "must supply installation path"
else:
if self.exec_prefix is None:
self.exec_prefix = self.prefix
self.install_base = self.prefix
self.install_platbase = self.exec_prefix
self.select_scheme("unix_prefix")
AUTHOR = 'Zope Corporation and Contributors'
ZOPE_ROOT = os.path.abspath(os.getcwd())
EXTENSIONCLASS_ROOT = os.path.join(ZOPE_ROOT, 'lib', 'Components', 'ExtensionClass')
......@@ -988,13 +1020,14 @@ distutils_setup(
headers=setup_info.get('headers', []),
ext_modules=setup_info.get('ext_modules', []),
cmdclass={'install_data': install_data}
cmdclass={'install': install, 'install_data': install_data}
)
distutils_setup(
name='Zope',
author=AUTHOR,
py_modules=setup_info.get('py_modules', [])
py_modules=setup_info.get('py_modules', []),
cmdclass={'install': install, 'install_data': install_data}
)
setup_info = {}
......@@ -1071,11 +1104,12 @@ distutils_setup(
headers=setup_info.get('headers', []),
ext_modules=setup_info.get('ext_modules', []),
cmdclass={'install_data': install_data}
cmdclass={'install': install, 'install_data': install_data}
)
distutils_setup(
name='Zope',
author=AUTHOR,
py_modules=setup_info.get('py_modules', [])
py_modules=setup_info.get('py_modules', []),
cmdclass={'install': install, 'install_data': install_data}
)
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