Commit 23b84958 authored by Łukasz Nowak's avatar Łukasz Nowak

Fix typo: promisee -> promise.

parent 98f36c4e
......@@ -104,36 +104,36 @@ def guessPlatform():
class Script:
"""Free script building system"""
def _checkPromisee(self, location):
promisee_problem_list = []
a = promisee_problem_list.append
for promisee in self.options['slapos_promisee'].split('\n'):
promisee = promisee.strip()
if not promisee:
def _checkPromise(self, location):
promise_problem_list = []
a = promise_problem_list.append
for promise in self.options['slapos_promise'].split('\n'):
promise = promise.strip()
if not promise:
continue
if promisee.startswith('file:') or promisee.startswith('statlib'):
s, path = promisee.split(':')
if promise.startswith('file:') or promise.startswith('statlib'):
s, path = promise.split(':')
if not os.path.exists(os.path.join(location, path)):
a('File promisee not met for %r' % path)
elif promisee.startswith('directory'):
s, path = promisee.split(':')
a('File promise not met for %r' % path)
elif promise.startswith('directory'):
s, path = promise.split(':')
if not os.path.isdir(os.path.join(location, path)):
a('Directory promisee not met for %r' %
a('Directory promise not met for %r' %
path)
elif promisee.startswith('dynlib:'):
if 'linked:' not in promisee:
raise zc.buildout.UserError('dynlib promisee requires \'linked:\' '
elif promise.startswith('dynlib:'):
if 'linked:' not in promise:
raise zc.buildout.UserError('dynlib promise requires \'linked:\' '
'parameter.')
if 'rpath:' not in promisee:
if 'rpath:' not in promise:
rpath_list = []
for promisee_part in promisee.split():
if promisee_part.startswith('dynlib:'):
s, path = promisee_part.split(':')
elif promisee_part.startswith('linked:'):
s, link_list = promisee_part.split(':')
for promise_part in promise.split():
if promise_part.startswith('dynlib:'):
s, path = promise_part.split(':')
elif promise_part.startswith('linked:'):
s, link_list = promise_part.split(':')
link_list = link_list.split(',')
elif promisee_part.startswith('rpath:'):
s, rpath_list = promisee_part.split(':')
elif promise_part.startswith('rpath:'):
s, rpath_list = promise_part.split(':')
if rpath_list:
r = rpath_list
rpath_list = []
......@@ -144,20 +144,20 @@ class Script:
else:
rpath_list = []
if not os.path.exists(os.path.join(location, path)):
a('Dynlib promisee file not met %r' % promisee)
a('Dynlib promise file not met %r' % promise)
else:
elf_dict = readElfAsDict(os.path.join(location, path))
if sorted(link_list) != sorted(elf_dict['library_list']):
a('Promisee library list not met (wanted: %r, found: %r)' % (
a('Promise library list not met (wanted: %r, found: %r)' % (
link_list, elf_dict['library_list']))
if sorted(rpath_list) != sorted(elf_dict['runpath_list']):
a('Promisee rpath list not met (wanted: %r, found: %r)' % (
a('Promise rpath list not met (wanted: %r, found: %r)' % (
rpath_list, elf_dict['runpath_list']))
else:
raise zc.buildout.UserError('Unknown promisee %r' % promisee)
if len(promisee_problem_list):
raise zc.buildout.UserError('Promisee not met, found issues:\n %s' %
' '.join([q + '\n' for q in promisee_problem_list]))
raise zc.buildout.UserError('Unknown promise %r' % promise)
if len(promise_problem_list):
raise zc.buildout.UserError('Promise not met, found issues:\n %s' %
' '.join([q + '\n' for q in promise_problem_list]))
def download(self, url, md5sum):
download = zc.buildout.download.Download(self.buildout['buildout'],
......@@ -279,7 +279,7 @@ class Script:
env = self.getEnvironment()
exec self.options['script']
try:
self._checkPromisee(self.options['location'])
self._checkPromise(self.options['location'])
except Exception:
if os.path.exists(self.options['location']):
self.logger.info('Removing location %r because of error' %
......
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