Commit 313184b6 authored by Julien Muchembled's avatar Julien Muchembled

default: only set default 'location' option if there's an install script

parent 90a2ee51
......@@ -227,11 +227,6 @@ class Script(EnvironMixin):
self.buildout = buildout
self.name = name
self.logger = logging.getLogger('SlapOS build of %s' % self.name)
try:
self.options['location'] = self.options['location'].strip()
except KeyError:
self.options['location'] = os.path.join(
buildout['buildout']['parts-directory'], self.name)
missing = True
keys = 'init', 'install', 'update'
for option in keys:
......@@ -247,17 +242,21 @@ class Script(EnvironMixin):
self.keep_on_error = True
else:
self.keep_on_error = False
if self._install and 'location' not in options:
options['location'] = os.path.join(
buildout['buildout']['parts-directory'], self.name)
EnvironMixin.__init__(self, False)
if self._init:
self._exec(self._init)
def _exec(self, script):
options = self.options
exec(script, dict(GLOBALS,
self=self,
options=options,
location=options['location'],
))
g = dict(GLOBALS, self=self, options=options)
try:
g['location'] = options['location']
except KeyError:
pass
exec(script, g)
def install(self):
if not self._install:
......
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