Commit cdff9aa0 authored by Vincent Pelletier's avatar Vincent Pelletier

Reverse the order in which repositories are added to sys.path.

Detailed rationale:
erp5/softwre.cfg defines
  repository_id_list = erp5
It is not possible to prepend a value to another in buildout configuration
file syntax, but provides a way to append:
  repository_id_list += foo
In such case, when running tests, one will want to access the test(s)
folder project's repository. But that folder will be shadowed by erp5's.
There is no trivial fix without drawbacks, and this fix is trivial enough
to be considered better than other fixes.
parent b1280ca8
......@@ -244,7 +244,7 @@ initialization =
os.environ['SOFTWARE_HOME'] = os.path.abspath(os.path.dirname(os.path.dirname(Zope2.__file__)))
os.environ['ZOPE_SCRIPTS'] = ''
parts_directory = '''${buildout:parts-directory}'''
repository_id_list = '''${erp5_repository_list:repository_id_list}'''.split()
repository_id_list = '''${erp5_repository_list:repository_id_list}'''.split().reverse()
temp_bt5_path_list = ['/'.join([parts_directory, x, 'bt5']) for x in repository_id_list]
bt5_path_list = []
[bt5_path_list.extend([bt5_path, '%s/*' % bt5_path]) for bt5_path in temp_bt5_path_list]
......@@ -274,7 +274,7 @@ initialization =
import Zope2
os.environ['SOFTWARE_HOME'] = os.path.abspath(os.path.dirname(os.path.dirname(Zope2.__file__)))
os.environ['ZOPE_SCRIPTS'] = ''
sys.path[0:0] = ['/'.join(['''${buildout:parts-directory}''', x]) for x in '''${erp5_repository_list:repository_id_list}'''.split()]
sys.path[0:0] = ['/'.join(['''${buildout:parts-directory}''', x]) for x in '''${erp5_repository_list:repository_id_list}'''.split()].reverse()
[instance-recipe-egg]
recipe = zc.recipe.egg
......
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