Commit a9195197 authored by Jim Fulton's avatar Jim Fulton

When generating distribution signatures, the location of a non-develop

egg is not important.
parent 412c9227
...@@ -436,14 +436,13 @@ class Buildout(dict): ...@@ -436,14 +436,13 @@ class Buildout(dict):
def _compute_part_signatures(self, parts): def _compute_part_signatures(self, parts):
# Compute recipe signature and add to options # Compute recipe signature and add to options
base = self['buildout']['eggs-directory'] + os.path.sep
for part in parts: for part in parts:
options = self.get(part) options = self.get(part)
if options is None: if options is None:
options = self[part] = {} options = self[part] = {}
recipe, entry = self._recipe(part, options) recipe, entry = self._recipe(part, options)
req = pkg_resources.Requirement.parse(recipe) req = pkg_resources.Requirement.parse(recipe)
sig = _dists_sig(pkg_resources.working_set.resolve([req]), base) sig = _dists_sig(pkg_resources.working_set.resolve([req]))
options['__buildout_signature__'] = ' '.join(sig) options['__buildout_signature__'] = ' '.join(sig)
def _recipe(self, part, options): def _recipe(self, part, options):
...@@ -754,16 +753,14 @@ def _dir_hash(dir): ...@@ -754,16 +753,14 @@ def _dir_hash(dir):
hash.update(open(os.path.join(dirpath, name)).read()) hash.update(open(os.path.join(dirpath, name)).read())
return hash.digest().encode('base64').strip() return hash.digest().encode('base64').strip()
def _dists_sig(dists, base): def _dists_sig(dists):
result = [] result = []
for dist in dists: for dist in dists:
location = dist.location location = dist.location
if dist.precedence == pkg_resources.DEVELOP_DIST: if dist.precedence == pkg_resources.DEVELOP_DIST:
result.append(dist.project_name + '-' + _dir_hash(location)) result.append(dist.project_name + '-' + _dir_hash(location))
else: else:
if location.startswith(base): result.append(os.path.basename(location))
location = location[len(base):]
result.append(location)
return result return result
def _update(d1, d2): def _update(d1, d2):
......
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