Commit 2eba5086 authored by Xavier Thompson's avatar Xavier Thompson

[feat] Let recipe.update access installed paths

Store a part's installed paths in `self[part].installed_files` before
calling `recipe.update()`, to allow the part's recipe to read them if
needed by looking up `options.installed_files`.

Delete this attribute just after the call to ensure this data remains
private to the part.

This will allow zc.recipe.egg:develop to remember in `update()` which
.egg-link it installed in `install()`; inferring this would otherwise
require essentially reinstalling the egg from the setup path, as that
is all the recipe gets as input.

Storing this under `__buildout_installed__` in the part's options was
considered, but some recipes take all the recorded key/value pairs as
input, so it would be a breaking change.
parent 038ecb98
......@@ -1000,6 +1000,8 @@ class Buildout(DictMixin):
part)
try:
self[part].installed_files = [
p for p in installed_files.split('\n') if p]
updated_files = self[part]._call(update)
except Exception:
installed_parts.remove(part)
......@@ -1007,6 +1009,8 @@ class Buildout(DictMixin):
installed_part_options['buildout']['parts'] = (
' '.join(installed_parts))
raise
finally:
del self[part].installed_files
installed_files = set(installed_files.split('\n')) \
if installed_files else set()
......
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