Commit 2c922f22 authored by Reinout van Rees's avatar Reinout van Rees

Using more robust checking if we've upgraded ourselves

With an extension (like mr.developer) that depends on setuptools *and* with
the new update-the-workingset-immediately functionality introduced in 2.11,
the old have-we-been-upgraded-ourselves functionality didn't function reliably
anymore.
parent d6dcdd8f
......@@ -1083,10 +1083,13 @@ class Buildout(DictMixin):
)
upgraded = []
# The setuptools/zc.buildout locations at the time we started was
# recorded in easy_install.py. We use that here to check if we've been
# upgraded.
start_locations = zc.buildout.easy_install.buildout_and_setuptools_path
for project in 'zc.buildout', 'setuptools':
req = pkg_resources.Requirement.parse(project)
project_location = pkg_resources.working_set.find(req).location
if ws.find(req).location != project_location:
if ws.find(req).location not in start_locations:
upgraded.append(ws.find(req))
if not upgraded:
......
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