diff options
Diffstat (limited to 'setuptools')
-rwxr-xr-x | setuptools/command/bdist_rpm.py | 22 | ||||
-rw-r--r-- | setuptools/command/install.py | 46 |
2 files changed, 27 insertions, 41 deletions
diff --git a/setuptools/command/bdist_rpm.py b/setuptools/command/bdist_rpm.py index 4db04a32..1a0b0484 100755 --- a/setuptools/command/bdist_rpm.py +++ b/setuptools/command/bdist_rpm.py @@ -6,12 +6,6 @@ from distutils.command.bdist_rpm import bdist_rpm as _bdist_rpm class bdist_rpm(_bdist_rpm): - user_options = _bdist_rpm.user_options + [ - ('no-egg', None, "Don't install as an egg (may break the package!)") - ] - - boolean_options = _bdist_rpm.boolean_options + ['no-egg'] - def initialize_options(self): _bdist_rpm.initialize_options(self) self.no_egg = None @@ -31,24 +25,16 @@ class bdist_rpm(_bdist_rpm): "Source0: %{name}-%{version}.tar", "Source0: %{name}-%{unmangled_version}.tar" ).replace( + "setup.py install ", + "setup.py install --single-version-externally-managed " + ).replace( "%setup", "%setup -n %{name}-%{unmangled_version}" ).replace(line23,line24) for line in spec ] spec.insert(spec.index(line24)+1, "%define unmangled_version "+version) - - - if not self.no_egg: - return spec - - # Hack the spec file so that we install old-style - return [ - line.replace( - "setup.py install ","setup.py install --old-and-unmanageable " - ) for line in spec - ] - + return spec diff --git a/setuptools/command/install.py b/setuptools/command/install.py index 51d4ffe0..77b97b67 100644 --- a/setuptools/command/install.py +++ b/setuptools/command/install.py @@ -1,29 +1,47 @@ import setuptools, sys from distutils.command.install import install as _install +from distutils.errors import DistutilsArgError class install(_install): """Use easy_install to install the package, w/dependencies""" user_options = _install.user_options + [ ('old-and-unmanageable', None, "Try not to use this!"), + ('single-version-externally-managed', None, + "used by system package builders to create 'flat' eggs"), ] - boolean_options = _install.boolean_options + ['old-and-unmanageable'] + boolean_options = _install.boolean_options + [ + 'old-and-unmanageable', 'single-version-externally-managed', + ] + + sub_commands = _install.sub_commands + [ + ('install_egg_info', lambda self: True), + ] def initialize_options(self): _install.initialize_options(self) self.old_and_unmanageable = None + self.single_version_externally_managed = None self.no_compile = None # make DISTUTILS_DEBUG work right! + def finalize_options(self): + _install.initialize_options(self) + if self.single_version_externally_managed: + if not self.root and not self.record: + raise DistutilsArgError( + "You must specify --record or --root when building system" + " packages" + ) + def handle_extra_path(self): - # We always ignore extra_path, because we always install eggs - # (you can always use install_* commands directly if needed) + # We always ignore extra_path, because we install as .egg or .egg-info self.path_file = None self.extra_dirs = '' def run(self): - if (self.old_and_unmanageable or - sys._getframe(1).f_globals.get('__name__','') != 'distutils.dist' + if (self.old_and_unmanageable or self.single_version_externally_managed + or sys._getframe(1).f_globals.get('__name__','') != 'distutils.dist' ): # Either we were asked for the old behavior, or we're not being # run from the command line. This is a bit kludgy, because a @@ -50,24 +68,6 @@ class install(_install): cmd.run() setuptools.bootstrap_install_from = None - sub_commands = _install.sub_commands + [ - ('install_egg_info', lambda self: True), - ] - - - - - - - - - - - - - - - |