Fix Licenses values for CDDL and Custom URL (#27999)

* 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.
This commit is contained in:
Maxime Gréau 2018-01-08 19:36:33 +01:00 committed by GitHub
parent ff3db0b50e
commit c46222ea15
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

@ -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>
*
@ -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://raw.githubusercontent.com/elastic/elasticsearch/${gitBranch}/"
return "Custom:${license.getCanonicalPath().replaceFirst('.*/elasticsearch/', githubBaseURL)}"
return "Custom;${license.getCanonicalPath().replaceFirst('.*/elasticsearch/', githubBaseURL)}"
}
return spdx
} else {
@ -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'