ppalaga commented on code in PR #5166:
URL: https://github.com/apache/camel-quarkus/pull/5166#discussion_r1289882075


##########
tooling/scripts/sanity-checks.groovy:
##########
@@ -68,10 +68,11 @@ int compareVersion(String a, String b) {
     List verB = b.tokenize('.')
 
     def commonIndices = Math.min(verA.size(), verB.size())
+    def versionRegex = ~/\-.*/
 
     for (int i = 0; i < commonIndices; ++i) {
        def numA = verA[i].toInteger()
-       def numB = verB[i].toInteger()
+       def numB = (verB[i] - versionRegex).toInteger()

Review Comment:
   I am bit lost what is this doing. The minus operator removes the matching 
part from the string, right?
   I this way we are effectively disregard the `-RC` qualifiers, right? 
   That's definitely OK for this current versions check, but I wonder whether 
it would not be safer for future copy-and-paste visitors, to move the suffix 
stripping before the compareVersion() method. After all we strip `-SNAPSHOT` 
from project.version before passing it to compareVersion() too. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to