From: Jonathan Rajotte Date: Tue, 17 Mar 2015 19:46:21 +0000 (-0400) Subject: Rename KernelVersion To basicVersion X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=81470b33fe2f384919f6365ed9ab65aa11907223;p=lttng-ci.git Rename KernelVersion To basicVersion --- diff --git a/dsl/kernel-lttng-modules.seed.groovy b/dsl/kernel-lttng-modules.seed.groovy index 6096fd4..3403525 100644 --- a/dsl/kernel-lttng-modules.seed.groovy +++ b/dsl/kernel-lttng-modules.seed.groovy @@ -2,7 +2,7 @@ enum KernelVersioning { MAJOR,MINOR,REVISION,BUILD } -class KernelVersion implements Comparable { +class BasicVersion implements Comparable { int major = -1 int minor = -1 int revision = -1 @@ -11,10 +11,10 @@ class KernelVersion implements Comparable { String gitRefs // Default Constructor - KernelVersion() {} + BasicVersion() {} - // Parse a version string of format X,Y,Z,W-A - KernelVersion(String version, String ref) { + // Parse a version string of format X.Y.Z.W-A + BasicVersion(String version, String ref) { gitRefs = ref def tokenVersion def token @@ -22,7 +22,7 @@ class KernelVersion implements Comparable { // Release canditate token = version.tokenize('-') tokenVersion = token[0] - if (token[1].isInteger()) { + if (token[1]?.isInteger()) { rc = token[1].toInteger() } } else { @@ -33,7 +33,7 @@ class KernelVersion implements Comparable { def tagEnum = KernelVersioning.MAJOR tokenVersion.each { - if (it.isInteger()) { + if (it?.isInteger()) { switch (tagEnum) { case KernelVersioning.MAJOR: major = it.toInteger() @@ -55,13 +55,12 @@ class KernelVersion implements Comparable { println("Unsupported version extension") println("Trying to parse: ${version}") println("Invalid sub version value: ${it}") - //TODO: throw exception for jenkins + //TODO: throw exception for jenkins } } } } - String print() { String ret = "" if (major != -1) { @@ -83,12 +82,13 @@ class KernelVersion implements Comparable { } @Override - int compareTo(KernelVersion kernelVersion) { + int compareTo(BasicVersion kernelVersion) { return major <=> kernelVersion.major ?: minor <=> kernelVersion.minor ?: revision <=> kernelVersion.revision ?: build <=> kernelVersion.build ?: rc <=> kernelVersion.rc } } -def cutoff = [major: 3, minor: 19,revision:-1, build:-1, rc:-1] +def cutoff = new BasicVersion("3.19", "") +def modulesBranches = ["master","stable-2.5.0","stable-2.6.0"] def linuxURL = "git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git" def modulesURL = "git://git.lttng.org/lttng-modules.git"