Support wildcards in 0.x versions

Fixes: https://pagure.io/fedora-rust/rust2rpm/issue/173
Signed-off-by: Igor Raits <igor.raits@gmail.com>
This commit is contained in:
Igor Raits 2022-01-09 08:08:17 +01:00
parent dc4dd1c6e0
commit fbcb8d0d3e
No known key found for this signature in database
GPG key ID: 115D5AB89C5C1E1E
2 changed files with 9 additions and 1 deletions

View file

@ -128,7 +128,7 @@ class CargoSemVer:
if kind == CargoSemVer.KIND_ANY:
normalized.append((CargoSemVer.KIND_GTE,
CargoSemVer.coerce(version)))
if version.major:
if version.major is not None:
if version.minor is not None:
upper_version = CargoSemVer.next_minor(version)
else:

View file

@ -29,6 +29,14 @@ from rust2rpm.metadata import Version
"(crate(test) >= 1.0.0 with crate(test) < 2.0.0~)"),
("*",
"crate(test) >= 0.0.0"),
("0.*",
"(crate(test) >= 0.0.0 with crate(test) < 1.0.0~)"),
("0.0.*",
"(crate(test) >= 0.0.0 with crate(test) < 0.1.0~)"),
("0.1.*",
"(crate(test) >= 0.1.0 with crate(test) < 0.2.0~)"),
("0.*.*",
"(crate(test) >= 0.0.0 with crate(test) < 1.0.0~)"),
("1.*",
"(crate(test) >= 1.0.0 with crate(test) < 2.0.0~)"),
("1.2.*",