Commit be2e94b3 authored by Jérome Perrin's avatar Jérome Perrin Committed by Xavier Thompson

[fixup] Ignore _profile_base_location_ when computing signatures

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

This commit may fixup "Support ${:_profile_base_location_}." but is
purposefuly kept separate because it concerns parts signatures which
are an orthogonal feature.
parent b9d3a7f8
......@@ -1621,9 +1621,16 @@ 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_')
# access values through .get() instead of .items() to detect unused keys
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