Commit 709a50dd authored by Julien Muchembled's avatar Julien Muchembled Committed by Xavier Thompson

[fix] Check that sections don't install the same path

parent d638e279
......@@ -931,7 +931,9 @@ class Buildout(DictMixin):
# Check for unused buildout options:
_check_for_unused_options_in_section(self, 'buildout')
# install new parts
all_installed_paths = {}
for part in install_parts:
signature = self[part].pop('__buildout_signature__')
saved_options = self[part].copy()
......@@ -962,11 +964,11 @@ class Buildout(DictMixin):
' '.join(installed_parts))
raise
installed_files = set(installed_files.split('\n')) \
if installed_files else set()
if updated_files:
installed_files = set(installed_files.split('\n'))
(installed_files.add if isinstance(updated_files, str) else
installed_files.update)(updated_files)
installed_files = '\n'.join(sorted(installed_files))
else: # install
__doing__ = 'Installing %s.', part
......@@ -979,9 +981,23 @@ class Buildout(DictMixin):
"The %s install returned None. A path or "
"iterable os paths should be returned.",
part)
installed_files = ""
elif not isinstance(installed_files, str):
installed_files = '\n'.join(installed_files)
elif installed_files:
installed_files = ({installed_files}
if isinstance(installed_files, str) else
set(installed_files))
if installed_files:
conflicts = installed_files.intersection(
all_installed_paths)
if conflicts:
self._error(
"The following paths are already"
" installed by other sections: %r",
{x: all_installed_paths[x] for x in conflicts})
all_installed_paths.update(dict.fromkeys(installed_files, part))
installed_files = '\n'.join(sorted(installed_files))
else:
installed_files = ''
saved_options['__buildout_installed__'] = installed_files
saved_options['__buildout_signature__'] = signature
......
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