Commit 488dbbc2 authored by Kirill Smelkov's avatar Kirill Smelkov

Fix handling of CUPS url

Without the fix cups version was not detected.

Occurs in Cloudooo.
parent 3218660b
......@@ -294,6 +294,8 @@ def namever(url, failonerr=True): # -> (name, ver) | None if !failonerr
s = removesuffix(s, tail)
for tail in ['-py2.7'] + ['-py3.%d' % _ for _ in range(20)]:
s = removesuffix(s, tail)
for tail in ('-source',):
s = removesuffix(s, tail)
return s
url = del_tgztail(url)
......
......@@ -41,6 +41,7 @@ from os.path import dirname, exists
('https://osdn.net/frs/redir.php?f=tsukurimashou%2F56948%2Focr-0.2.zip', 'ocr', '0.2'),
('http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.tar.gz', 'GeoLite2-Country', None),
('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://www.cups.org/software/1.7.4/cups-1.7.4-source.tar.bz2', 'cups', '1.7.4'),
])
def test_namever(url, nameok, verok):
assert nxdbom.namever(url) == (nameok, verok)
......
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