diff options
author | steveblock@chromium.org <steveblock@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-14 11:57:42 +0000 |
---|---|---|
committer | steveblock@chromium.org <steveblock@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-14 11:57:42 +0000 |
commit | 756b04e1e06ba31f280515049358d20720fa2ca9 (patch) | |
tree | 4d315de91f5f94e83e29c436275ab429cc412376 | |
parent | 47ac1123ed47690127044afdf3c5b38fd386ba6e (diff) | |
download | chromium_src-756b04e1e06ba31f280515049358d20720fa2ca9.zip chromium_src-756b04e1e06ba31f280515049358d20720fa2ca9.tar.gz chromium_src-756b04e1e06ba31f280515049358d20720fa2ca9.tar.bz2 |
Add a function to provide the list of third-party directories which are incompatible with Android.
For most directories, we use a regex of whitelisted licenses to parse the 'License' field from the metadata. In some case, for example, where a custom license is used, we rely on a new 'Android Compatibility' field.
This functionality will be used by the snapshot tool, which will exclude these incompatible directories from the snapshot in the Android tree.
BUG=138921
Review URL: https://chromiumcodereview.appspot.com/10829272
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151462 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | android_webview/tools/third_party_files_whitelist.txt | 2 | ||||
-rwxr-xr-x | android_webview/tools/webview_licenses.py | 34 | ||||
-rw-r--r-- | third_party/README.chromium.template | 1 | ||||
-rw-r--r-- | third_party/handlebar/README.chromium | 2 | ||||
-rw-r--r-- | third_party/iccjpeg/README.chromium | 1 | ||||
-rw-r--r-- | third_party/khronos/README.chromium | 5 | ||||
-rw-r--r-- | third_party/libXNVCtrl/README.chromium | 2 | ||||
-rw-r--r-- | third_party/libjpeg/README.chromium | 1 | ||||
-rw-r--r-- | third_party/libpng/README.chromium | 1 | ||||
-rw-r--r-- | third_party/smhasher/README.chromium | 4 | ||||
-rw-r--r-- | third_party/zlib/README.chromium | 1 | ||||
-rwxr-xr-x | tools/licenses.py | 3 |
12 files changed, 52 insertions, 5 deletions
diff --git a/android_webview/tools/third_party_files_whitelist.txt b/android_webview/tools/third_party_files_whitelist.txt index e478f2e..cd63150 100644 --- a/android_webview/tools/third_party_files_whitelist.txt +++ b/android_webview/tools/third_party_files_whitelist.txt @@ -49,6 +49,8 @@ chrome/app/theme/chromium/BRANDING # license. This third-party code is taken from Mozilla, the license for which # we already pick up from third_party/npapi/. chrome/browser/download/download_extensions.cc +# String 'copyright' used in code. +chrome/browser/importer/firefox_importer_utils.cc # Copyright Netscape Communications Corporation; MPL, GPL v2 or LGPL v2 # license. Not used on Android. chrome/browser/importer/firefox_profile_lock.cc diff --git a/android_webview/tools/webview_licenses.py b/android_webview/tools/webview_licenses.py index e15e164..338a426 100755 --- a/android_webview/tools/webview_licenses.py +++ b/android_webview/tools/webview_licenses.py @@ -31,6 +31,40 @@ sys.path.append(os.path.join(REPOSITORY_ROOT, 'tools')) import licenses +def GetIncompatibleDirectories(): + """Gets a list of third-party directories which use licenses incompatible + with Android. This is used by the snapshot tool. + Returns: + A list of directories. + """ + + whitelist = [ + 'Apache( Version)? 2(\.0)?', + '(New )?BSD( 3-Clause)?( with advertising clause)?', + 'L?GPL ?v?2(\.[01])?( or later)?', + 'MIT(/X11)?(-like)?', + 'MPL 1\.1 ?/ ?GPL 2(\.0)? ?/ ?LGPL 2\.1', + 'Microsoft Limited Public License', + 'Microsoft Permissive License', + 'Public Domain', + 'SGI Free Software License B', + 'X11', + ] + regex = '^(%s)$' % '|'.join(whitelist) + result = [] + for directory in _FindThirdPartyDirs(): + metadata = licenses.ParseDir(directory) + if metadata.get('License Android Compatible', 'no') == 'yes': + continue + license = re.split(' [Ll]icenses?$', metadata['License'])[0] + tokens = [x.strip() for x in re.split(' and |,', license) if len(x) > 0] + for token in tokens: + if not re.match(regex, token, re.IGNORECASE): + result.append(directory) + break + return result + + def _CheckLicenseHeaders(directory_list, whitelisted_files): """Checks that all files which are not in a listed third-party directory, and which do not use the standard Chromium license, are whitelisted. diff --git a/third_party/README.chromium.template b/third_party/README.chromium.template index 24698de..7294612 100644 --- a/third_party/README.chromium.template +++ b/third_party/README.chromium.template @@ -7,6 +7,7 @@ Revision: (OPTIONAL if version is supplied) The current revision of the package License: The license under which the package is distributed. Arbitrary text is allowed, but prefer standard forms, eg MIT/X11/BSD/Apache 2.0/GPL/LGPL.
License File: (OPTIONAL) File that contains a copy of the package's license. Use the special value NOT_SHIPPED to indicate that the package is not included in the shipped product, so its license does not need to be included in about:credits and no license file is required.
Security Critical: Either yes or no depending on whether this package is shipped in releases. For example openssl is critical where cygwin is not.
+License Android Compatible: (OPTIONAL) Whether the package uses a license compatible with Android. Required only if the package is compatible and the 'License' field uses a non-standard value.
Description:
A short description of what the package is and is used for.
diff --git a/third_party/handlebar/README.chromium b/third_party/handlebar/README.chromium index 47d49b2..bb6ffbd 100644 --- a/third_party/handlebar/README.chromium +++ b/third_party/handlebar/README.chromium @@ -4,7 +4,7 @@ URL: https://github.com/kalman/templates Version: 0 Date: July 13, 2012 Revision: commit 606e9f31a240173e5d6c0b8768159c2e2835da42 -License: Apache License, Version 2.0 +License: Apache 2.0 Security Critical: no Description: diff --git a/third_party/iccjpeg/README.chromium b/third_party/iccjpeg/README.chromium index 9413989..5722ecc 100644 --- a/third_party/iccjpeg/README.chromium +++ b/third_party/iccjpeg/README.chromium @@ -4,6 +4,7 @@ Version: unknown License: Custom license License File: LICENSE Security Critical: yes +License Android Compatible: yes Description: Contain support for ICC color profile on top of jpeg6b (and up) library. diff --git a/third_party/khronos/README.chromium b/third_party/khronos/README.chromium index bbdba9c..837d13e 100644 --- a/third_party/khronos/README.chromium +++ b/third_party/khronos/README.chromium @@ -3,7 +3,7 @@ Short Name: khronos_headers URL: http://www.khronos.org/registry Version: unknown Date: 2012-02-01 -License: MIT/X11 (BSD like) for {EGL,KHR}/*, SGI Free Software License B for GLES2/* +License: MIT/X11, SGI Free Software License B Security Critical: no Description: @@ -11,6 +11,9 @@ This package contains header files for the EGL and OpenGL ES 2.0 APIs from Khronos. They are used for compiling code against these APIs as well as for generating the GL binding initialization logic. +MIT/X11 (BSD like) license is for {EGL,KHR}/*, SGI Free Software License B is +for GLES2/*. + Local Modifications: GLES2/gl2.h diff --git a/third_party/libXNVCtrl/README.chromium b/third_party/libXNVCtrl/README.chromium index 95e398a..12398a8 100644 --- a/third_party/libXNVCtrl/README.chromium +++ b/third_party/libXNVCtrl/README.chromium @@ -3,7 +3,7 @@ Short Name: libXNVCtrl URL: cgit.freedesktop.org/~aplattner/nvidia-settings/ Version: unknown Date: 2008 -License: MIT license. +License: MIT Security Critical: no Description: diff --git a/third_party/libjpeg/README.chromium b/third_party/libjpeg/README.chromium index b46be95..a484d3b 100644 --- a/third_party/libjpeg/README.chromium +++ b/third_party/libjpeg/README.chromium @@ -3,6 +3,7 @@ URL: http://www.ijg.org/ Version: 6b License: Custom license Security Critical: yes +License Android Compatible: yes Description: This contains a copy of libjpeg-6b. diff --git a/third_party/libpng/README.chromium b/third_party/libpng/README.chromium index 283376f..39d57b5 100644 --- a/third_party/libpng/README.chromium +++ b/third_party/libpng/README.chromium @@ -3,6 +3,7 @@ URL: http://libpng.org/ Version: 1.2.45 Security Critical: yes License: libpng license +License Android Compatible: yes Description: Our custom configuration options are defined in pngusr.h. This was previously diff --git a/third_party/smhasher/README.chromium b/third_party/smhasher/README.chromium index 3c96573..c6eb1fc 100644 --- a/third_party/smhasher/README.chromium +++ b/third_party/smhasher/README.chromium @@ -2,7 +2,7 @@ Name: SMHasher URL: http://code.google.com/p/smhasher/ Version: 0 Revision: 146 -License: MIT (SMHasher), Public Domain (MurmurHash) +License: MIT, Public Domain License File: LICENSE Security Critical: yes @@ -10,3 +10,5 @@ Description: This is a library containing the MurmurHash3 function, and a hashing function test suite. +Licenses are MIT (SMHasher) and Public Domain (MurmurHash). + diff --git a/third_party/zlib/README.chromium b/third_party/zlib/README.chromium index 9bd3109..aa5d4a5 100644 --- a/third_party/zlib/README.chromium +++ b/third_party/zlib/README.chromium @@ -3,6 +3,7 @@ URL: http://zlib.net/ Version: 1.2.5 Security Critical: yes License: Custom license +License Android Compatible: yes Description: General purpose compression library diff --git a/tools/licenses.py b/tools/licenses.py index d4140f8..c95d531 100755 --- a/tools/licenses.py +++ b/tools/licenses.py @@ -109,6 +109,7 @@ SPECIAL_CASES = { "Name": "open-vcdiff", "URL": "http://code.google.com/p/open-vcdiff", "License": "Apache 2.0, MIT, GPL v2 and custom licenses", + "License Android Compatible": "yes", }, os.path.join('testing', 'gmock'): { "Name": "gmock", @@ -247,7 +248,7 @@ def ParseDir(path): # Relative path to a file containing some html we're required to place in # about:credits. - optional_keys = ["Required Text"] + optional_keys = ["Required Text", "License Android Compatible"] if path in SPECIAL_CASES: metadata.update(SPECIAL_CASES[path]) |