mirror of
https://github.com/rpm-software-management/tito.git
synced 2025-02-23 12:12:47 +00:00
Remove '-.*' from the end of git-annex version strings.
RPMs provided by git-annex have a '-{hash}' added to the version, breaking version detection. This was the simplest way I could come up with to get around this issue, based on what was already implemented.
This commit is contained in:
parent
bb3e661124
commit
b562607a4d
1 changed files with 1 additions and 1 deletions
|
@ -1045,7 +1045,7 @@ def compare_version(version1, version2):
|
|||
zero when equal and positive when version1 > version2.
|
||||
"""
|
||||
def normalize(v):
|
||||
return [int(x) for x in re.sub(r'(\.0+)*$', '', v).split(".")]
|
||||
return [int(x) for x in re.sub(r'(\.0+)*$', '', re.sub(r'(-.*)$', '', v)).split(".")]
|
||||
a = normalize(version1)
|
||||
b = normalize(version2)
|
||||
return (a > b) - (a < b)
|
||||
|
|
Loading…
Add table
Reference in a new issue