From b562607a4d90efeb1c01e41d47596fbbfa9f8450 Mon Sep 17 00:00:00 2001 From: Patrick Creech Date: Thu, 2 Jun 2022 11:46:11 -0400 Subject: [PATCH] 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. --- src/tito/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tito/common.py b/src/tito/common.py index 8c9fe89..f0c53f6 100644 --- a/src/tito/common.py +++ b/src/tito/common.py @@ -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)