diff options
| author | PJ Eby <distutils-sig@python.org> | 2005-08-22 13:40:10 +0000 |
|---|---|---|
| committer | PJ Eby <distutils-sig@python.org> | 2005-08-22 13:40:10 +0000 |
| commit | b577c94170b64436919bea8e002c64623d0a9644 (patch) | |
| tree | b35c56a641742b554c66e854d6c815b978c61420 /setuptools/command | |
| parent | cbccc4eafde18db71a6dc6a23ec0d39c582655d3 (diff) | |
| download | python-setuptools-git-b577c94170b64436919bea8e002c64623d0a9644.tar.gz | |
Make easy_install --record strip the RPM root when building RPMs, and have
bdist_egg ignore the RPM root when building an egg. This version now can
actually run bdist_rpm to completion, although the resulting RPM will
install an egg without a corresponding .pth file.
--HG--
branch : setuptools
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041226
Diffstat (limited to 'setuptools/command')
| -rw-r--r-- | setuptools/command/bdist_egg.py | 4 | ||||
| -rwxr-xr-x | setuptools/command/easy_install.py | 14 | ||||
| -rw-r--r-- | setuptools/command/install.py | 3 |
3 files changed, 13 insertions, 8 deletions
diff --git a/setuptools/command/bdist_egg.py b/setuptools/command/bdist_egg.py index eb92bd24..1f17bb82 100644 --- a/setuptools/command/bdist_egg.py +++ b/setuptools/command/bdist_egg.py @@ -170,7 +170,11 @@ class bdist_egg(Command): # pull their data path from the install_lib command. log.info("installing library code to %s" % self.bdist_dir) + instcmd = self.get_finalized_command('install') + old_root = instcmd.root + instcmd.root = None cmd = self.call_command('install_lib', warn_dir=0) + instcmd.root = old_root ext_outputs = cmd._mutate_outputs( self.distribution.has_ext_modules(), 'build_ext', 'build_lib', '' diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index e0a98b62..3f754af6 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -90,6 +90,7 @@ class easy_install(Command): self.optimize = self.record = None self.upgrade = self.always_copy = self.multi_version = None self.editable = None + self.root = None # Options not specifiable via command line self.package_index = None @@ -120,7 +121,6 @@ class easy_install(Command): - def finalize_options(self): # If a non-default installation directory was specified, default the # script directory to match it. @@ -224,9 +224,14 @@ class easy_install(Command): for spec in self.args: self.easy_install(spec, True) if self.record: + outputs = self.outputs + if self.root: # strip any package prefix + root_len = len(self.root) + for counter in xrange(len(outputs)): + outputs[counter] = outputs[counter][root_len:] from distutils import file_util self.execute( - file_util.write_file, (self.record, self.outputs), + file_util.write_file, (self.record, outputs), "writing list of installed files to '%s'" % self.record ) @@ -239,11 +244,6 @@ class easy_install(Command): - - - - - def add_output(self, path): if os.path.isdir(path): for base, dirs, files in os.walk(path): diff --git a/setuptools/command/install.py b/setuptools/command/install.py index f438dda6..c555e7e0 100644 --- a/setuptools/command/install.py +++ b/setuptools/command/install.py @@ -23,7 +23,8 @@ class install(_install): from setuptools.command.easy_install import easy_install cmd = easy_install( - self.distribution, args="x", ignore_conflicts_at_my_risk=1 + self.distribution, args="x", ignore_conflicts_at_my_risk=1, + root=self.root ) cmd.ensure_finalized() # finalize before bdist_egg munges install cmd |
