Skip to content

Improve storage of package declared licenses #1403

Description

@pombredanne

Description

The declared license of a package is what we find in a package manifest license-related fields.
Today we take the values of fields and use a simple line separation.
Instead we should keep the field names and store that as JSON too, keeping some of the original structure such that we can a better determination/normalization of the license when we populate the license_expression field.

For instance this is a Maven POM snippet:

<licenses>
    <license>
        <name>BSD</name>
        <url>http://www.jcraft.com/jzlib/LICENSE.txt</url>
    </license>
</licenses>

and an npm package.json snippet (rather weird as it has both a legacy and new style of license tags:

{
  "license": "Apache-2.0",
...
  "licenses": [
    {
      "type": "Apache 2.0",
      "url": "https://github.com/spenceralger/grunt-esvm/blob/master/LICENSE.md"
    }
  ],
...
}

We should in these cases store and report something such as:

  • maven: "name": "BSD, "url": http://www.jcraft.com/jzlib/LICENSE.txt"
  • npm: "license": "Apache-2.0", "type": "Apache 2.0", "url": "https://github.com/spenceralger/grunt-esvm/blob/master/LICENSE.md"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions