Skip to content

Commit

Permalink
Allow tilde as extra version separator
Browse files Browse the repository at this point in the history
RPM allows the use of tilde in Version tag. Moreover, the Fedora
Packaging Guidelines mention tilde as a possible way of specifying
prereleases. See the following link for more information:
https://docs.fedoraproject.org/en-US/packaging-guidelines/Versioning/

Signed-off-by: František Nečas <fifinecas@seznam.cz>
  • Loading branch information
FrNecas committed Jun 26, 2020
1 parent d750b1e commit 6371659
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion rebasehelper/specfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ def split_version_string(version_string: str, current_version: str) -> Tuple[str
RebaseHelperError in case passed version string is not valid.
"""
version_re = re.compile(r'^(\d+[.\d]*\d+|\d+)(\.|-|_|\+)?(\w+)?$')
version_re = re.compile(r'^(\d+[.\d]*\d+|\d+)(\.|-|_|\+|~)?(\w+)?$')
m = version_re.match(version_string)
if not m:
raise RebaseHelperError('Invalid version string: {}'.format(version_string))
Expand Down
1 change: 1 addition & 0 deletions rebasehelper/tests/test_specfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ def test_split_version_string(self):
assert SpecFile.split_version_string('1.0.1rc1', '1.0.1') == ('1.0.1', 'rc1')
assert SpecFile.split_version_string('1.1.3-rc6', '1.1.3') == ('1.1.3', 'rc6')
assert SpecFile.split_version_string('1.1.3_rc6', '1.1.3') == ('1.1.3', 'rc6')
assert SpecFile.split_version_string('1.1.3~rc6', '1.1.3') == ('1.1.3', 'rc6')
assert SpecFile.split_version_string('1.1.1d', '1.1.1c') == ('1.1.1d', None)

def test_extract_version_from_archive_name(self):
Expand Down

0 comments on commit 6371659

Please sign in to comment.