diff --git a/rust2rpm/metadata.py b/rust2rpm/metadata.py index 9990fca..e163e78 100644 --- a/rust2rpm/metadata.py +++ b/rust2rpm/metadata.py @@ -85,6 +85,8 @@ class Dependency(object): if "*" in s and s != "*": # XXX: https://github.com/rbarrois/python-semanticversion/issues/51 s = "~{}".format(s.replace(".*", "", 1)) + if ".*" in s: + s = s.replace(".*", "") spec = semver.Spec(s.replace(" ", "")) parsed = [] for req in spec.specs: diff --git a/test.py b/test.py index bbe8e4e..c69cbe6 100644 --- a/test.py +++ b/test.py @@ -210,6 +210,16 @@ def cargo_toml(request): """, ["crate(hello) = 0.0.0"], ["(crate(libc) >= 1.2.0 with crate(libc) < 1.3.0)"]), + (""" + [package] + name = "hello" + version = "0.0.0" + + [dependencies] + libc = "1.*.*" + """, + ["crate(hello) = 0.0.0"], + ["(crate(libc) >= 1.0.0 with crate(libc) < 2.0.0)"]), # Inequality requirements ("""