Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly report double licensed project and allow to skip file #8443

Merged
merged 1 commit into from
Sep 26, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 3 additions & 32 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2974,40 +2974,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------
Dependency: gopkg.in/yaml.v2
Revision: cd8b52f8269e0feb286dfeef29f8fe4d5b397e0b
License type (autodetected): MIT
./vendor/gopkg.in/yaml.v2/LICENSE.libyaml:
License type (autodetected): Apache-2.0
./vendor/gopkg.in/yaml.v2/LICENSE:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE: This is a dual license project.

--------------------------------------------------------------------
The following files were ported to Go from C files of libyaml, and thus
are still covered by their original copyright and license:

apic.go
emitterc.go
parserc.go
readerc.go
scannerc.go
writerc.go
yamlh.go
yamlprivateh.go

Copyright (c) 2006 Kirill Simonov

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
Apache License 2.0

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

--------------------------------------------------------------------
Dependency: gopkg.in/yaml.v2
Expand Down
25 changes: 23 additions & 2 deletions dev-tools/generate_notice.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import json
import csv
import re
import copy


def read_file(filename):
Expand Down Expand Up @@ -59,7 +60,8 @@ def gather_dependencies(vendor_dirs, overrides=None):
print("WARNING: No version information found for: {}".format(lib_path))
lib = {"path": lib_path}
else:
lib = lib_search[0]
lib = copy.deepcopy(lib_search[0])

lib["license_file"] = os.path.join(root, filename)

lib["license_contents"] = read_file(lib["license_file"])
Expand All @@ -79,16 +81,22 @@ def gather_dependencies(vendor_dirs, overrides=None):
# don't walk down into another vendor dir
if "vendor" in dirs:
dirs.remove("vendor")

return dependencies


# Allow to skip files that could match the `LICENSE` pattern but does not have any license information.
SKIP_FILES = [
]


def get_licenses(folder):
"""
Get a list of license files from a given directory.
"""
licenses = []
for filename in sorted(os.listdir(folder)):
if filename.startswith("LICENSE") and "docs" not in filename:
if filename.startswith("LICENSE") and "docs" not in filename and os.path.join(folder, filename) not in SKIP_FILES:
licenses.append(filename)
elif filename.startswith("APLv2"): # gorhill/cronexpr
licenses.append(filename)
Expand Down Expand Up @@ -241,6 +249,19 @@ def create_notice(filename, beat, copyright, vendor_dirs, csvfile, overrides=Non
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
"""),
re.sub(r"\s+", " ", """Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
"""),
]

BSD_LICENSE_CONTENTS = [
Expand Down