summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaurav-Aggarwal-AWS <33462878+aggarg@users.noreply.github.com>2021-08-19 14:51:26 -0700
committerGitHub <noreply@github.com>2021-08-19 14:51:26 -0700
commit1b2c5605caea2c614fd0e18fd1e72c36d121492c (patch)
treef726c934a5c8c4c66190a7fd32231b2d15f775df
parent687c50f390d34c8a8cf9fe7a0b23460dd8da0213 (diff)
downloadfreertos-git-1b2c5605caea2c614fd0e18fd1e72c36d121492c.tar.gz
Update code to extract versions from string (#678)
This is needed to correctly handle patch versions. Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
-rwxr-xr-x.github/scripts/release.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/.github/scripts/release.py b/.github/scripts/release.py
index 0ac4af3ff..98de05f36 100755
--- a/.github/scripts/release.py
+++ b/.github/scripts/release.py
@@ -253,8 +253,9 @@ class KernelRelease(BaseRelease):
def updateVersionMacros(self, version_str):
info('Updating version macros in task.h for "%s"' % version_str)
- # Strip out any non-numeric or '.' characters before setting major / minor / build
- (major, minor, build) = re.sub("[^0-9.]", "", version_str).split('.')
+ # Extract major / minor / build from the version string.
+ ver = re.search(r'([\d.]+)', version_str).group(1)
+ (major, minor, build) = ver.split('.')
update_freertos_version_macros(os.path.join(self.repo_path, 'include', 'task.h'), version_str, major, minor, build)
self.commitChanges(self.commit_msg_prefix + 'Bump task.h version macros to "%s"' % version_str)