rust2rpm: replace hyphens by underscores in version

- fix issue#124
This commit is contained in:
Daniel Gonçalves 2021-09-28 19:00:01 +02:00
parent 22804aeab0
commit 0089888cd7

View file

@ -75,9 +75,9 @@ class CargoSemVer:
version_str = f'{version.major}.{version.minor or 0}' \ version_str = f'{version.major}.{version.minor or 0}' \
f'.{version.patch or 0}' f'.{version.patch or 0}'
if version.pre_release: 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: if version.build:
version_str = f'{version_str}+{version.build}' version_str = f'{version_str}+{version.build.replace("-", "_")}'
return version_str return version_str
@staticmethod @staticmethod