Commit 4b90d0a4 authored by Kirill Smelkov's avatar Kirill Smelkov

namever: Treat rfcXXX as non-version

This fixes version detection for strict_rfc3339-0.7-py2.7.egg :

    def test_namever(url, nameok, verok):
>       assert nxdbom.namever(url) == (nameok, verok)
E       AssertionError: assert ('strict', 'rfc3339-0.7') == ('strict_rfc3339', '0.7')
E         At index 0 diff: 'strict' != 'strict_rfc3339'
E         Full diff:
E         - ('strict_rfc3339', '0.7')
E         ?         ^       ^^^^
E         + ('strict', 'rfc3339-0.7')
E         ?         ^^^^       ^
parent ab9720a0
...@@ -358,6 +358,8 @@ def _namever(url, failonerr): ...@@ -358,6 +358,8 @@ def _namever(url, failonerr):
isver = 'patch' in v or \ isver = 'patch' in v or \
'slapospatched' in v or \ 'slapospatched' in v or \
v_ndigit > (len(v)-1) / 3 v_ndigit > (len(v)-1) / 3
if 'rfc' in v: # ex strict_rfc3339-0.7
isver = False
if not isver: # doesn't look like a version if not isver: # doesn't look like a version
break break
name = name[:m.start()] name = name[:m.start()]
......
...@@ -47,6 +47,7 @@ from os.path import dirname, exists ...@@ -47,6 +47,7 @@ from os.path import dirname, exists
('http://snowball.tartarus.org/dist/libstemmer_c.tgz', 'libstemmer_c', None), ('http://snowball.tartarus.org/dist/libstemmer_c.tgz', 'libstemmer_c', None),
('https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.0-patch1/src/hdf5-1.10.0-patch1.tar.bz2', 'hdf5', '1.10.0-patch1'), ('https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.10/hdf5-1.10.0-patch1/src/hdf5-1.10.0-patch1.tar.bz2', 'hdf5', '1.10.0-patch1'),
('http://ftp.debian.org/debian/pool/main/f/findutils/findutils_4.8.0.orig.tar.xz', 'findutils', '4.8.0'), ('http://ftp.debian.org/debian/pool/main/f/findutils/findutils_4.8.0.orig.tar.xz', 'findutils', '4.8.0'),
('strict_rfc3339-0.7-py2.7.egg', 'strict_rfc3339', '0.7'),
]) ])
def test_namever(url, nameok, verok): def test_namever(url, nameok, verok):
assert nxdbom.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