Commit ab661f01 authored by Julien Muchembled's avatar Julien Muchembled

default: execute 'init' after the 'location' option is automatically set

This makes 'init' able to set other options that depend on location.
It's still free to change options['location'] if the part is not shared.
parent 9b17086a
......@@ -226,23 +226,24 @@ class Script(EnvironMixin):
else:
self.keep_on_error = False
EnvironMixin.__init__(self, False)
if self._init:
self._exec(self._init)
shared = Shared(buildout, name, options)
if self._update:
shared.assertNotShared("option 'update' can't be set")
if self._install:
location = options.get('location')
if location:
shared.assertNotShared("option 'location' can't be set")
shared.location = location
else:
if not options.get('location'):
options['location'] = shared.location
if self._init:
self._exec(self._init)
if shared.location != options['location']:
shared.assertNotShared("option 'location' can't be set")
shared.location = options['location']
shared.keep_on_error = True
shared.mkdir_location = False
self._shared = shared
else:
shared.assertNotShared("option 'install' must be set")
if self._init:
self._exec(self._init)
def _exec(self, script):
options = self.options
......@@ -251,7 +252,6 @@ class Script(EnvironMixin):
g['location'] = options['location']
except KeyError:
pass
linecache.cache[self.name] = (
len(script),
None,
......
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