diff --git a/rust2rpm/metadata.py b/rust2rpm/metadata.py index a630ce9..db52c77 100644 --- a/rust2rpm/metadata.py +++ b/rust2rpm/metadata.py @@ -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: diff --git a/test.py b/test.py index 62acb4f..29ff704 100644 --- a/test.py +++ b/test.py @@ -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.*",