Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions tests/test_rpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ def test_package_no_arch(version_info):
(('0', '1.0', '5a'), ('1', '1.0', '5a'), -1),
(('0', '1.1', '5a'), ('0', '1.0', '5a'), 1),
(('0', '1.0', '5a'), ('0', '1.0', '5b'), -1),
((u'0', u'2.02.98', u'9.el6_4.2'), (u'0', u'2.02.98', u'9.el6.'), 1),
]


Expand Down
2 changes: 2 additions & 0 deletions version_utils/rpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,8 @@ def compare_versions(version_a, version_b):
logger.debug('starting loop comparing %s '
'to %s', chars_a, chars_b)
_check_leading(chars_a, chars_b)
if len(chars_a) == 0 or len(chars_b) == 0:
break
if chars_a[0] == '~' and chars_b[0] == '~':
map(lambda x: x.pop(0), (chars_a, chars_b))
elif chars_a[0] == '~':
Expand Down