Commit c74b3dc5 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent f2d5abea
......@@ -68,6 +68,28 @@ def bom_software(installed_cfg): # -> set of 'name-version' XXX
else:
name, ver = namever(url)
elif recipe == 'slapos.recipe.build:download':
# slapos.recipe.build:download is often used to download .conf files, but sometimes it is used to download e.g. binaries
# skip the part, if we can detect that downloaded item is a configuration file
if isconf(part['url']):
continue
# TODO binary -> parse name/ver
raise NotImplementedError('%s uses %s with url that does not look like a .conf file: %s' % (s, recipe, url))
elif recipe.startswith('slapos.recipe.template'):
url = part.get('url', None)
if url is not None:
if isconf(part['url']):
continue
# NOTE binary is not expected with slapos.recipe.template
raise ValueError('%s uses %s with url that does not look like a .conf file: %s' % (s, recipe, url))
else:
# it is an inline= script
assert 'inline' in part, part
elif recipe == 'zc.recipe.egg:custom':
eggpath = part['__buildout_installed__']
assert len(eggpath.split()) == 1, eggpath # no spaces inside - just one item
......@@ -123,6 +145,15 @@ def _namever(url):
return name, ver
# isconf returns whether url points to data related to configuration file (contrary to e.g. binary executable)
def isconf(url):
if url.endswith('.conf.in') or \
url.endswith('.cfg.in') or \
url.endswith('/templates/wrapper.in') or \
url.endswith('/logrotate_entry.in') :
return True
return False
# ----------------------------------------
def main():
......
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