diff --git a/rust2rpm/metadata.py b/rust2rpm/metadata.py index b29e7b5..c0ce530 100644 --- a/rust2rpm/metadata.py +++ b/rust2rpm/metadata.py @@ -75,9 +75,9 @@ class CargoSemVer: version_str = f'{version.major}.{version.minor or 0}' \ f'.{version.patch or 0}' if version.pre_release: - version_str = f'{version_str}{sep}{version.pre_release}' + version_str = f'{version_str}{sep}{version.pre_release.replace("-", "_")}' if version.build: - version_str = f'{version_str}+{version.build}' + version_str = f'{version_str}+{version.build.replace("-", "_")}' return version_str @staticmethod