From 4f1238112b53b505d1e582ee543348e357d0118d Mon Sep 17 00:00:00 2001
From: Pavel Korshunov <pavel.korshunov@idiap.ch>
Date: Mon, 9 Apr 2018 15:08:17 +0200
Subject: [PATCH] correcting version bumping in release script

---
 release/release_bob.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/release/release_bob.py b/release/release_bob.py
index 75fcb4f..84adfe3 100755
--- a/release/release_bob.py
+++ b/release/release_bob.py
@@ -154,12 +154,13 @@ def get_parsed_tag(gitpkg, tag):
             raise ValueError(
                 'The latest tag name {0} in package {1} has unknown format'.format('v' + latest_tag_name, gitpkg.name))
         # increase the version accordingly
+        major, minor, patch = latest_tag_name.split('.')
         if 'major' == tag:  # increment the first number in 'v#.#.#' but make minor and patch to be 0
-            return 'v' + str(int(latest_tag_name[0]) + 1) + '.0.0'
+            return 'v' + str(int(major) + 1) + '.0.0'
         if 'minor' == tag:  # increment the second number in 'v#.#.#' but make patch to be 0
-            return 'v' + latest_tag_name[:2] + str(int(latest_tag_name[2]) + 1) + '.0'
+            return 'v' + major + '.' + str(int(minor) + 1) + '.0'
         if 'patch' == tag:  # increment the last number in 'v#.#.#'
-            return 'v' + latest_tag_name[:-1] + str(int(latest_tag_name[-1]) + 1)
+            return 'v' + major + '.' + minor + '.' + str(int(patch) + 1)
 
     if 'none' == tag:  # we do nothing in this case
         return tag
-- 
GitLab