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

Fix typo: promisee -> promise.

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