be stricter about incrementable release values

This commit is contained in:
Mike McLean 2017-01-26 16:57:45 +01:00
parent 8b5a9cd08b
commit 4f2d1bc855
2 changed files with 4 additions and 3 deletions

View file

@ -3499,8 +3499,8 @@ def get_next_release(build_info):
release = '1'
elif release.isdigit():
release = str(int(release) + 1)
elif len(release.split('.')) > 1 and release.split('.')[0].isdigit():
# Handle the case of a disttag in the release field
elif len(release.split('.')) == 2 and release.split('.')[0].isdigit():
# Handle the N.%{dist} case
r_split = release.split('.')
r_split[0] = str(int(r_split[0]) + 1)
release = '.'.join(r_split)

View file

@ -33,7 +33,7 @@ class TestGetNextRelease(unittest.TestCase):
# [release, bumped_release],
['1.el6', '2.el6'],
['1.fc23', '2.fc23'],
['4.5.fc23', '4.6.fc23'],
['45.fc23', '46.fc23'],
]
for a, b in data:
self.query.executeOne.return_value = {'release': a}
@ -47,6 +47,7 @@ class TestGetNextRelease(unittest.TestCase):
"foo.bar",
"a.b.c.d",
"a..b..c",
"1.2.fc23",
]
for val in data:
self.query.executeOne.return_value = {'release': val}