File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
model/src/main/kotlin/utils Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ package org.ossreviewtoolkit.model.utils
2222import org.apache.logging.log4j.kotlin.logger
2323
2424import org.ossreviewtoolkit.model.Identifier
25+ import org.ossreviewtoolkit.utils.common.withoutSuffix
2526import org.ossreviewtoolkit.utils.ort.showStackTrace
2627
2728import org.semver4j.Semver
@@ -40,8 +41,12 @@ fun Identifier.hasIvyVersionRange(): Boolean = version.getIvyVersionRanges().get
4041 */
4142internal fun Identifier.isApplicableIvyVersion (pkgId : Identifier ): Boolean =
4243 runCatching {
44+ // Support "Exact Revision Matcher" syntax.
4345 if (version == pkgId.version) return true
4446
47+ // Support "Sub Revision Matcher" syntax.
48+ if (version.withoutSuffix(" +" )?.let { prefix -> pkgId.version.startsWith(prefix) } == true ) return true
49+
4550 // `Semver.satisfies(String)` requires a valid version range to work as expected, see:
4651 // https://github.com/semver4j/semver4j/issues/132.
4752 val ranges = version.getIvyVersionRanges()
You can’t perform that action at this time.
0 commit comments