From 011c3b43266ef68924db8c221f87959997705dd3 Mon Sep 17 00:00:00 2001 From: Samuel Attard Date: Wed, 12 Sep 2018 17:59:06 +1000 Subject: [PATCH] chore: make large beta numbers work when publishing (#14571) --- script/lib/util.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/script/lib/util.py b/script/lib/util.py index e77c6aea2232..d6cbac1e406d 100644 --- a/script/lib/util.py +++ b/script/lib/util.py @@ -246,13 +246,18 @@ def get_next_nightly(v): def non_empty(thing): return thing.strip() != '' +def beta_tag_compare(tag1, tag2): + p1 = parse_version(tag1) + p2 = parse_version(tag2) + return int(p1[3]) - int(p2[3]) + def get_next_beta(v): pv = clean_parse_version(v) tag_pattern = 'v' + pv[0] + '.' + pv[1] + '.' + pv[2] + '-beta.*' - tag_list = filter( + tag_list = sorted(filter( non_empty, execute(['git', 'tag', '--list', '-l', tag_pattern]).strip().split('\n') - ) + ), cmp=beta_tag_compare) if len(tag_list) == 0: return make_version(pv[0] , pv[1], pv[2], 'beta.1')