Trim off BoringSSL header boilerplate (flutter/engine#3347)

The first 23 lines of the BoringSSL license contain informational text
including Buganizer issue numbers that is not part of the license text
itself.
This commit is contained in:
Chris Bracken
2017-01-19 14:06:00 -08:00
committed by GitHub
parent 7f9239124d
commit 5e8b20a826
3 changed files with 8 additions and 1 deletions

View File

@@ -77,6 +77,8 @@ LicenseType convertBodyToType(String body) {
return LicenseType.gpl;
if (body.startsWith(lrAPSL))
return LicenseType.apsl;
if (body.contains(lrOpenSSL))
return LicenseType.openssl;
if (body.contains(lrBSD))
return LicenseType.bsd;
if (body.contains(lrMIT))

View File

@@ -2007,9 +2007,13 @@ class RepositoryBoringSSLSourceDirectory extends RepositoryDirectory {
}
}
/// The BoringSSL license file.
///
/// This license includes 23 lines of informational header text that are not
/// part of the copyright notices and can be skipped.
class RepositoryOpenSSLLicenseFile extends RepositorySingleLicenseFile {
RepositoryOpenSSLLicenseFile(RepositoryDirectory parent, fs.TextFile io)
: super(parent, io, new License.message(io.readString(), LicenseType.openssl, origin: io.fullName)) {
: super(parent, io, new License.message(LineSplitter.split(io.readString()).skip(23).join('\n'), LicenseType.openssl, origin: io.fullName)) {
_verifyLicense(io);
}

View File

@@ -170,6 +170,7 @@ final RegExp lrMPL = new RegExp(r'^(?: |\r|\n)*Mozilla Public License Version 2\
final RegExp lrGPL = new RegExp(r'^(?: |\r|\n)*GNU GENERAL PUBLIC LICENSE\n');
final RegExp lrAPSL = new RegExp(r'^APPLE PUBLIC SOURCE LICENSE Version 2\.0 +- +August 6, 2003');
final RegExp lrMIT = new RegExp(r'Permission(?: |\n)+is(?: |\n)+hereby(?: |\n)+granted,(?: |\n)+free(?: |\n)+of(?: |\n)+charge,(?: |\n)+to(?: |\n)+any(?: |\n)+person(?: |\n)+obtaining(?: |\n)+a(?: |\n)+copy(?: |\n)+of(?: |\n)+this(?: |\n)+software(?: |\n)+and(?: |\n)+associated(?: |\n)+documentation(?: |\n)+files(?: |\n)+\(the(?: |\n)+"Software"\),(?: |\n)+to(?: |\n)+deal(?: |\n)+in(?: |\n)+the(?: |\n)+Software(?: |\n)+without(?: |\n)+restriction,(?: |\n)+including(?: |\n)+without(?: |\n)+limitation(?: |\n)+the(?: |\n)+rights(?: |\n)+to(?: |\n)+use,(?: |\n)+copy,(?: |\n)+modify,(?: |\n)+merge,(?: |\n)+publish,(?: |\n)+distribute,(?: |\n)+sublicense,(?: |\n)+and/or(?: |\n)+sell(?: |\n)+copies(?: |\n)+of(?: |\n)+the(?: |\n)+Software,(?: |\n)+and(?: |\n)+to(?: |\n)+permit(?: |\n)+persons(?: |\n)+to(?: |\n)+whom(?: |\n)+the(?: |\n)+Software(?: |\n)+is(?: |\n)+furnished(?: |\n)+to(?: |\n)+do(?: |\n)+so,(?: |\n)+subject(?: |\n)+to(?: |\n)+the(?: |\n)+following(?: |\n)+conditions:');
final RegExp lrOpenSSL = new RegExp(r'Copyright \(c\) 1998-2011 The OpenSSL Project\. All rights reserved\.(.|\n)*Original SSLeay License');
final RegExp lrBSD = new RegExp(r'Redistribution(?: |\n)+and(?: |\n)+use(?: |\n)+in(?: |\n)+source(?: |\n)+and(?: |\n)+binary(?: |\n)+forms(?:(?: |\n)+of(?: |\n)+the(?: |\n)+software(?: |\n)+as(?: |\n)+well(?: |\n)+as(?: |\n)+documentation)?,(?: |\n)+with(?: |\n)+or(?: |\n)+without(?: |\n)+modification,(?: |\n)+are(?: |\n)+permitted(?: |\n)+provided(?: |\n)+that(?: |\n)+the(?: |\n)+following(?: |\n)+conditions(?: |\n)+are(?: |\n)+met:');
final RegExp lrZlib = new RegExp(r'Permission(?: |\n)+is(?: |\n)+granted(?: |\n)+to(?: |\n)+anyone(?: |\n)+to(?: |\n)+use(?: |\n)+this(?: |\n)+software(?: |\n)+for(?: |\n)+any(?: |\n)+purpose,(?: |\n)+including(?: |\n)+commercial(?: |\n)+applications,(?: |\n)+and(?: |\n)+to(?: |\n)+alter(?: |\n)+it(?: |\n)+and(?: |\n)+redistribute(?: |\n)+it(?: |\n)+freely,(?: |\n)+subject(?: |\n)+to(?: |\n)+the(?: |\n)+following(?: |\n)+restrictions:');
final RegExp lrPNG = new RegExp(r'This code is released under the libpng license\.');