Commit ed3cf0a3 authored by Kirill Smelkov's avatar Kirill Smelkov

Fix support for onlyoffice_core URL

BOM(CloudOOO) was failing as

    RuntimeError: Unsupported url: 'https://lab.nexedi.com/bk/onlyoffice_core/repository/archive.tar.bz2?ref=8a40eb47bd80a40ecde14c223525b21852d2fc9f'
parent b6efa70a
......@@ -282,6 +282,7 @@ def bom_node(XXX):
_gitweb_re = re.compile(r'/gitweb/\?p=(?P<name>\w+)\.git;a=snapshot;h=(?P<rev>\w+)')
_github_re = re.compile(r'/github.com/[\w\-]+/(?P<name>[\w\-]+)/archive/(refs/tags/)?(?P<rev>.+)$')
_github_rre= re.compile(r'/raw.githubusercontent.com/[\w\-]+/(?P<name>[\w\-]+)/(?P<rev>[\w\.\-]+)/')
_gitlab_re = re.compile(r'/lab.nexedi.com/[\w\-]+/(?P<name>[\w\-]+)/repository/archive.tar.(gz|bz2)\?ref=(?P<rev>.+)$')
_SF_re = re.compile(r'/sourceforge.net/.+/(?P<name>[\w\_]+)-(?P<rev>[\w\.]+)/download$')
_git_re = re.compile(r'/(?P<name>[\w\.\-]+)\.git$')
_go_re = re.compile(r'/golang.org/dl/(?P<name>go)(?P<rev>[\w\.]+).src$')
......@@ -320,7 +321,7 @@ def namever(url, failonerr=True): # -> (name, ver) | None if !failonerr
return name, ver
def _namever(url, failonerr):
for r in (_gitweb_re, _github_re, _github_rre, _SF_re, _go_re):
for r in (_gitweb_re, _github_re, _github_rre, _gitlab_re, _SF_re, _go_re):
m = r.search(url)
if m is not None:
return m.group('name'), m.group('rev')
......
......@@ -43,6 +43,7 @@ from os.path import dirname, exists
('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'),
('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'),
])
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