Commit d7ee97d9 authored by Jérome Perrin's avatar Jérome Perrin Committed by Julien Muchembled

Ignore _profile_base_location_ when computing signatures

We want two identical sections at different URL to be able to produce
same signature. This is feature is useful for slapos.recipe.cmmi's
shared parts.

Rebase instructions:
- squash with "apply "Support ${:_profile_base_location_}."
parent f60c396b
......@@ -1434,8 +1434,15 @@ class Options(DictMixin):
self.buildout._parts.append(name)
m = md5()
# _profile_base_location_ is ignored in signatures, so that two sections
# at different URLs can have same signature
_profile_base_location_ = self.get('_profile_base_location_')
for key in sorted(self.keys()):
if key == '_profile_base_location_':
continue
value = self._data.get(key, self._cooked.get(key, self._raw.get(key)))
if _profile_base_location_:
value = value.replace(_profile_base_location_, '${:_profile_base_location_}')
m.update(('%r\0%r\0' % (key, value)).encode())
self.items_signature = '%s:%s' % (name, m.hexdigest())
......
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