Commit f46be314 authored by Kirill Smelkov's avatar Kirill Smelkov

Fix support for libstemmer_c

It comes without a version.
Occurs in Wendelin.
parent ed3cf0a3
...@@ -53,7 +53,12 @@ def bom_software(installed_software_path): # -> {} (name,kind) -> PkgInfo ...@@ -53,7 +53,12 @@ def bom_software(installed_software_path): # -> {} (name,kind) -> PkgInfo
if version is not None: if version is not None:
assert ver is None assert ver is None
ver = version ver = version
assert ver is not None, urlpath if ver is None:
# some packages come without version in the url
if name in ('libstemmer_c',):
ver = ''
else:
assert ver is not None, urlpath
ver = removeprefix(ver, name+'-') # wendelin.core-2.0.alpha3-0-g6315384 -> 2.0.alpha3-0-g6315384 ver = removeprefix(ver, name+'-') # wendelin.core-2.0.alpha3-0-g6315384 -> 2.0.alpha3-0-g6315384
if '//' in urlpath: if '//' in urlpath:
url = urlpath url = urlpath
......
...@@ -44,6 +44,7 @@ from os.path import dirname, exists ...@@ -44,6 +44,7 @@ from os.path import dirname, exists
('http://www.cups.org/software/1.7.4/cups-1.7.4-source.tar.bz2', 'cups', '1.7.4'), ('http://www.cups.org/software/1.7.4/cups-1.7.4-source.tar.bz2', 'cups', '1.7.4'),
('https://github.com/unicode-org/icu/releases/download/release-58-2/icu4c-58_2-src.tgz', 'icu4c', '58_2'), ('https://github.com/unicode-org/icu/releases/download/release-58-2/icu4c-58_2-src.tgz', 'icu4c', '58_2'),
('https://lab.nexedi.com/bk/onlyoffice_core/repository/archive.tar.bz2?ref=8a40eb47bd80a40ecde14c223525b21852d2fc9f', 'onlyoffice_core', '8a40eb47bd80a40ecde14c223525b21852d2fc9f'), ('https://lab.nexedi.com/bk/onlyoffice_core/repository/archive.tar.bz2?ref=8a40eb47bd80a40ecde14c223525b21852d2fc9f', 'onlyoffice_core', '8a40eb47bd80a40ecde14c223525b21852d2fc9f'),
('http://snowball.tartarus.org/dist/libstemmer_c.tgz', 'libstemmer_c', None),
]) ])
def test_namever(url, nameok, verok): def test_namever(url, nameok, verok):
assert nxdbom.namever(url) == (nameok, verok) assert nxdbom.namever(url) == (nameok, verok)
...@@ -394,6 +395,15 @@ url = http://downloadarchive.documentfoundation.org/libreoffice/old/5.2.4.2/rpm/ ...@@ -394,6 +395,15 @@ url = http://downloadarchive.documentfoundation.org/libreoffice/old/5.2.4.2/rpm/
LibreOffice 5.2.4.2 http://downloadarchive.documentfoundation.org/libreoffice/old/5.2.4.2/rpm/x86_64/LibreOffice_5.2.4.2_Linux_x86-64_rpm.tar.gz LibreOffice 5.2.4.2 http://downloadarchive.documentfoundation.org/libreoffice/old/5.2.4.2/rpm/x86_64/LibreOffice_5.2.4.2_Linux_x86-64_rpm.tar.gz
""") """)
# libstemmer_c comes without version
case1("""\
[libstemmer]
recipe = slapos.recipe.cmmi
url = http://snowball.tartarus.org/dist/libstemmer_c.tgz
""", """\
libstemmer_c http://snowball.tartarus.org/dist/libstemmer_c.tgz
""")
@pytest.mark.parametrize('build,bomok', testv) @pytest.mark.parametrize('build,bomok', testv)
def test_bom_software(tmpdir, build, bomok): def test_bom_software(tmpdir, build, bomok):
......
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