Commit d675527e authored by PJ Eby's avatar PJ Eby

Fix some Subversion-related problems reported by John J. Lee:

* Fixed not installing dependencies for some packages fetched via Subversion

* Fixed dependency installation with ``--always-copy`` not using the same
  dependency resolution procedure as other operations.

* Fixed not fully removing temporary directories on Windows, if a Subversion
  checkout left read-only files behind

--HG--
branch : setuptools
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041382
parent 31a50d65
......@@ -865,6 +865,15 @@ Known Issues
* There's no automatic retry for borked Sourceforge mirrors, which can easily
time out or be missing a file.
0.6a8
* Fixed not installing dependencies for some packages fetched via Subversion
* Fixed dependency installation with ``--always-copy`` not using the same
dependency resolution procedure as other operations.
* Fixed not fully removing temporary directories on Windows, if a Subversion
checkout left read-only files behind
0.6a7
* Fixed not being able to install Windows script wrappers using Python 2.3
......
......@@ -10,7 +10,7 @@ file, or visit the `EasyInstall home page`__.
__ http://peak.telecommunity.com/DevCenter/EasyInstall
"""
import sys, os.path, zipimport, shutil, tempfile, zipfile, re
import sys, os.path, zipimport, shutil, tempfile, zipfile, re, stat
from glob import glob
from setuptools import Command
from setuptools.sandbox import run_setup
......@@ -318,7 +318,7 @@ class easy_install(Command):
finally:
if os.path.exists(tmpdir):
shutil.rmtree(tmpdir)
smart_rmtree(tmpdir)
......@@ -374,27 +374,22 @@ class easy_install(Command):
self.install_egg_scripts(dist)
self.installed_projects[dist.key] = dist
log.warn(self.installation_report(dist, *info))
if requirement is None:
requirement = dist.as_requirement()
if dist not in requirement:
return
if deps or self.always_copy:
log.info("Processing dependencies for %s", requirement)
else:
return
if self.always_copy:
# Recursively install *all* dependencies
for req in dist.requires(requirement.extras):
if req.key not in self.installed_projects:
self.easy_install(req)
if not deps and not self.always_copy:
return
elif requirement is not None and dist.key != requirement.key:
log.warn("Skipping dependencies for %s", dist)
return # XXX this is not the distribution we were looking for
if requirement is None or dist not in requirement:
# if we wound up with a different version, resolve what we've got
distreq = dist.as_requirement()
requirement = Requirement(
distreq.project_name, distreq.specs, requirement.extras
)
log.info("Processing dependencies for %s", requirement)
try:
WorkingSet([]).resolve(
distros = WorkingSet([]).resolve(
[requirement], self.local_index, self.easy_install
)
except DistributionNotFound, e:
......@@ -407,6 +402,11 @@ class easy_install(Command):
% e.args
)
if self.always_copy:
# Force all the relevant distros to be copied or activated
for dist in distros:
if dist.key not in self.installed_projects:
self.easy_install(dist.as_requirement())
def should_unzip(self, dist):
if self.zip_ok is not None:
......@@ -824,7 +824,7 @@ See the setuptools documentation for the "develop" command for more info.
args = list(args)
if self.verbose>2:
v = 'v' * self.verbose - 1
v = 'v' * (self.verbose - 1)
args.insert(0,'-'+v)
elif self.verbose<2:
args.insert(0,'-q')
......@@ -1183,6 +1183,47 @@ def main(argv=None, **kw):
def smart_rmtree(path):
"""Recursively delete a directory tree."""
cmdtuples = []
shutil._build_cmdtuple(path, cmdtuples)
for func, arg in cmdtuples:
try:
func(arg)
except OSError:
if os.name=='nt' and func is not os.rmdir:
os.chmod(arg, stat.S_IWRITE)
try:
func(arg)
continue
except OSError:
pass
exc = sys.exc_info()
raise exc[0], (exc[1][0], exc[1][1] + ' removing '+arg)
......
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