Commit 3ef92f4b authored by Kirill Smelkov's avatar Kirill Smelkov

Remove +slapospatchedXXX from URL of patched eggs

Even if slapos.buildout indicates that an egg was locally patched via
+slapospatchedXXX suffix, the URL of the egg should not have it.
parent a2107a92
......@@ -59,7 +59,12 @@ def bom_software(installed_software_path): # -> {} (name,kind) -> PkgInfo
else:
if kind == 'egg':
# XXX not strictly correct -> better retrieve the actual URL, but buildout does not save it in installed.cfg
url = 'https://pypi.org/project/%s/%s/' % (name, ver)
# remove +slapospatcheXXX suffix from egg url
v = ver
m = re.match(r'(?P<ver>.*)\+slapospatched.*', ver, re.I)
if m is not None:
v = m.group('ver')
url = 'https://pypi.org/project/%s/%s/' % (name, v)
else:
raise NotImplementedError('TODO url for kind %r (urlpath: %r)' % (kind, urlpath))
......
......@@ -242,6 +242,16 @@ aaa 1.2.3.egg https://pypi.org/project/aaa/1.2.3.egg/
bbb 5.6.7.egg https://pypi.org/project/bbb/5.6.7.egg/
""")
# +slapospatchedXXX is removed from egg URL
case1("""\
[astroid]
recipe = zc.recipe.egg:custom
__buildout_installed__ = /ROOT/develop-eggs/astroid-1.3.8+slapospatched001-py2.7.egg
""", """
>>> eggs:
astroid 1.3.8+slapospatched001 https://pypi.org/project/astroid/1.3.8/
""")
# %20 in URL
case1("""\
[zabbix-agent]
......
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