From 7aaa821b791e8a33857b3f6423fda68e8dca9d44 Mon Sep 17 00:00:00 2001 From: Dirk Zimoch Date: Thu, 24 Sep 2015 14:35:42 +0200 Subject: [PATCH] handle tags like XXX_1_2_3 as well as 1.2.3 --- App/tools/getVersion.tcl | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/App/tools/getVersion.tcl b/App/tools/getVersion.tcl index c78509b..7188e2b 100755 --- a/App/tools/getVersion.tcl +++ b/App/tools/getVersion.tcl @@ -155,7 +155,7 @@ scanmatch $git_context {fatal: No names found} { set version test } -scanmatch $git_context {_([0-9]+)[_.]([0-9]+)([_.]([0-9]+))?$} { +scanmatch $git_context {([0-9]+)\.([0-9]+)(\.([0-9]+))?$} { set major $matchInfo(submatch0) set minor $matchInfo(submatch1) set patch [expr $matchInfo(submatch3) + 0] @@ -163,7 +163,15 @@ scanmatch $git_context {_([0-9]+)[_.]([0-9]+)([_.]([0-9]+))?$} { puts stderr "checking tag $matchInfo(line) => version $version" } -scanmatch $git_context {_(.*[0-9]+[_.][0-9]+([_.][0-9]+)?)-([0-9]+)-g} { +scanmatch $git_context {_([0-9]+)_([0-9]+)(_([0-9]+))?$} { + set major $matchInfo(submatch0) + set minor $matchInfo(submatch1) + set patch [expr $matchInfo(submatch3) + 0] + set version $major.$minor.$patch + puts stderr "checking tag $matchInfo(line) => version $version" +} + +scanmatch $git_context {(.*[0-9]+[_.][0-9]+([_.][0-9]+)?)-([0-9]+)-g} { set version test puts stderr "tag $matchInfo(submatch0) is $matchInfo(submatch2) commits old => version test" }