Commit 3a6a293b authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

Add referred parts' hash strings in __buildout_signature__, that invokes...

Add referred parts' hash strings in __buildout_signature__, that invokes rebuild of a part when one of its (recursive) dependencies are modified.

Also remove duplicates and sort entries in __buildout_signature__.
parent 8a6f7a7e
1.6.0-dev-SlapOS-013
--------------------
- Add referred parts' hash strings in __buildout_signature__, that invokes
rebuild of a part when one of its (recursive) dependencies are modified.
1.6.0-dev-SlapOS-012 1.6.0-dev-SlapOS-012
-------------------- --------------------
......
...@@ -933,7 +933,10 @@ class Buildout(UserDict.DictMixin): ...@@ -933,7 +933,10 @@ class Buildout(UserDict.DictMixin):
options = self[part] = {} options = self[part] = {}
recipe, entry = _recipe(options) recipe, entry = _recipe(options)
req = pkg_resources.Requirement.parse(recipe) req = pkg_resources.Requirement.parse(recipe)
sig = _dists_sig(pkg_resources.working_set.resolve([req])) sig = sorted(set(_dists_sig(pkg_resources.working_set.resolve([req]))))
for dependency in sorted(getattr(options, '_dependency', [])):
dependency_hash = md5(repr(self.get(dependency))).hexdigest()
sig.append('%s:%s' % (dependency, dependency_hash))
options['__buildout_signature__'] = ' '.join(sig) options['__buildout_signature__'] = ' '.join(sig)
def _read_installed_part_options(self): def _read_installed_part_options(self):
...@@ -1372,6 +1375,7 @@ class Options(UserDict.DictMixin): ...@@ -1372,6 +1375,7 @@ class Options(UserDict.DictMixin):
self._raw = data self._raw = data
self._cooked = {} self._cooked = {}
self._data = {} self._data = {}
self._dependency = set([])
def _initialize(self): def _initialize(self):
name = self.name name = self.name
...@@ -1503,6 +1507,8 @@ class Options(UserDict.DictMixin): ...@@ -1503,6 +1507,8 @@ class Options(UserDict.DictMixin):
section, option = s section, option = s
if not section: if not section:
section = self.name section = self.name
elif section != 'buildout':
self._dependency.add(section)
v = self.buildout[section].get(option, None, seen, v = self.buildout[section].get(option, None, seen,
lastlevel=lastlevel) lastlevel=lastlevel)
if v is None: if v is None:
......
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