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

Sort NOTICE file by library path #4367

Merged
merged 1 commit into from May 22, 2017

Conversation

Projects
None yet
2 participants
@ruflin
Copy link
Collaborator

commented May 22, 2017

Currently the NOTICE file was sorted based on the licenses in each glob which overall made it hard to find specific licenses. Now the overall license file is sorted based on the path of each license library. This had the affect that in case a dependency was moved, the NOTICE file changed which should not be the case.

This has also the affect that duplicated license files are removed in case a dependency exists in more then one vendor directory which can be the case. A notice is logged in case a license is already known which helps to identify potential duplicates.

The sorting happens alphabetically ignoring upper / lower case.

@ruflin ruflin force-pushed the ruflin:sort-licenses branch from fb86017 to f853b38 May 22, 2017

@@ -82,16 +91,16 @@ def create_notice(filename, beat, copyright, licenses):

cwd = os.getcwd()
notice = os.path.join(cwd, "NOTICE")
licenses = []
license_globs = []

for root, dirs, files in os.walk(args.vendor):

This comment has been minimized.

Copy link
@andrewkroh

andrewkroh May 22, 2017

Member

Can you filter out the .git dir? I see it searching inside there when I run it and it really shouldn't be looking in there.

This comment has been minimized.

Copy link
@ruflin

ruflin May 22, 2017

Author Collaborator

I couldn't ignore dot directories for the walk but did ignore all dirs starting with a dot afterwards.


# Sort licenses by package path, ignore upper / lower case
for key in sorted(licenses, key=str.lower):

This comment has been minimized.

Copy link
@andrewkroh
Sort NOTICE file by library path
Currently the NOTICE file was sorted based on the licenses in each glob which overall made it hard to find specific licenses. Now the overall license file is sorted based on the path of each license library. This had the affect that in case a dependency was moved, the NOTICE file changed which should not be the case.

This has also the affect that duplicated license files are removed in case a dependency exists in more then one vendor directory which can be the case. A notice is logged in case a license is already known which helps to identify potential duplicates.

The sorting happens alphabetically ignoring upper / lower case

@ruflin ruflin force-pushed the ruflin:sort-licenses branch from f853b38 to d9f53cd May 22, 2017

@andrewkroh andrewkroh merged commit a3054ae into elastic:master May 22, 2017

3 of 4 checks passed

continuous-integration/appveyor/pr Waiting for AppVeyor build to complete
Details
CLA Commit author has signed the CLA
Details
beats-ci Build finished.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

ramon-garcia added a commit to ramon-garcia/beats that referenced this pull request Dec 5, 2017

Sort NOTICE file by library path (elastic#4367)
Currently the NOTICE file was sorted based on the licenses in each glob which overall made it hard to find specific licenses. Now the overall license file is sorted based on the path of each license library. This had the affect that in case a dependency was moved, the NOTICE file changed which should not be the case.

This has also the affect that duplicated license files are removed in case a dependency exists in more then one vendor directory which can be the case. A notice is logged in case a license is already known which helps to identify potential duplicates.

The sorting happens alphabetically ignoring upper / lower case

athom added a commit to athom/beats that referenced this pull request Jan 25, 2018

Sort NOTICE file by library path (elastic#4367)
Currently the NOTICE file was sorted based on the licenses in each glob which overall made it hard to find specific licenses. Now the overall license file is sorted based on the path of each license library. This had the affect that in case a dependency was moved, the NOTICE file changed which should not be the case.

This has also the affect that duplicated license files are removed in case a dependency exists in more then one vendor directory which can be the case. A notice is logged in case a license is already known which helps to identify potential duplicates.

The sorting happens alphabetically ignoring upper / lower case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.