Commit e0437e84 authored by Jérome Perrin's avatar Jérome Perrin

understand slapos.recipe.cmmi from path=

parent ba8f96b6
...@@ -114,7 +114,12 @@ def bom_software(installed_software_path): # -> {} (name,kind) -> PkgInfo ...@@ -114,7 +114,12 @@ def bom_software(installed_software_path): # -> {} (name,kind) -> PkgInfo
recipe = part['recipe'].rsplit('==', 1)[0] recipe = part['recipe'].rsplit('==', 1)[0]
if recipe == 'slapos.recipe.cmmi': if recipe == 'slapos.recipe.cmmi':
addbom(geturl(part), '') # XXX detect kind? if part.get('path', raw=True):
url = geturl(part, default=None)
else:
url = geturl(part)
if url:
addbom(url, '') # XXX detect kind?
elif recipe == 'slapos.recipe.build': elif recipe == 'slapos.recipe.build':
# slapos.recipe.build is often used in creative ways to actually # slapos.recipe.build is often used in creative ways to actually
...@@ -129,7 +134,6 @@ def bom_software(installed_software_path): # -> {} (name,kind) -> PkgInfo ...@@ -129,7 +134,6 @@ def bom_software(installed_software_path): # -> {} (name,kind) -> PkgInfo
# ZODB, ZEO, ... are similar as well # ZODB, ZEO, ... are similar as well
if s in ('gcc', 'python', 'ZODB', 'ZEO', 'tempstorage', 'generic_testrunner_init'): if s in ('gcc', 'python', 'ZODB', 'ZEO', 'tempstorage', 'generic_testrunner_init'):
continue continue
raise NotImplementedError('%s uses %s without url' % (s, recipe)) raise NotImplementedError('%s uses %s without url' % (s, recipe))
else: else:
......
...@@ -138,6 +138,21 @@ url = http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.tar.gz ...@@ -138,6 +138,21 @@ url = http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.tar.gz
GeoLite2-Country dc6224c6 http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.tar.gz GeoLite2-Country dc6224c6 http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.tar.gz
""") """)
# slapos.recipe.build from a git clone
case1("""\
[shellinabox-repository]
recipe = slapos.recipe.build:gitclone
repository = https://github.com/shellinabox/shellinabox
revision = b8285748993c4c99e80793775f3d2a0a4e962d5a
[shellinabox]
recipe = slapos.recipe.cmmi
path = ${shellinabox-repository:location}
""", """
>>> gits:
shellinabox b8285748993c4c99e80793775f3d2a0a4e962d5a https://github.com/shellinabox/shellinabox
""")
for x in ('gcc', 'python', 'ZODB', 'ZEO', 'tempstorage', 'generic_testrunner_init'): for x in ('gcc', 'python', 'ZODB', 'ZEO', 'tempstorage', 'generic_testrunner_init'):
case1("""\ case1("""\
[%s] [%s]
......
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