Commit ff053785 authored by Xavier Thompson's avatar Xavier Thompson

[fixup] Ignore ${:_profile_base_location_} for reinstall

Fixup "[fixup] Ignore _profile_base_location_ when computing signatures"
Fixup "[feat] Support ${:_profile_base_location_}"

Do not reinstall a section just because its ${:_profile_base_location_}
changed. This is coherent with ignoring ${:_profile_base_location_} for
part signatures.
parent 60f66680
......@@ -939,9 +939,9 @@ class Buildout(DictMixin):
if not uninstall_missing:
continue
else:
old_options = installed_part_options[part].copy()
old_options = installed_part_options[part].normalize()
installed_files = old_options.pop('__buildout_installed__')
new_options = self.get(part).copy()
new_options = self.get(part).normalize()
if old_options == new_options:
# The options are the same, but are all of the
# installed files still there? If not, we should
......@@ -1737,8 +1737,14 @@ 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
for key, value in self._iteritems_normalized():
m.update(('%r\0%r\0' % (key, value)).encode())
self.items_signature = '%s:%s' % (name, m.hexdigest())
def _iteritems_normalized(self):
# _profile_base_location_ is ignored in signatures and when comparing
# options, so that two sections at different URLs can have the same
# signature and compare equal
_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()):
......@@ -1747,8 +1753,10 @@ class Options(DictMixin):
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())
yield key, value
def normalize(self):
return dict(self._iteritems_normalized())
def _do_extend_raw(self, name, data, doing):
if name == 'buildout':
......
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