domcleal/spdx-licenses

Multiple/combined licence parsing support

domcleal opened this issue · 3 comments

2.0 is in the works, which changes how "+" (or later) licenses are expressed.

http://wiki.spdx.org/view/Legal_Team/Decisions/license_expression_syntax has some information.

It might mean this library has to parse the licence text a little (it probably should already, to support and/or) and validate "GPL-3.0+" as being the "GPL-3.0" licence.

Maybe I'll change the API to something more supportive of multiple licences, switching "exist" to "valid":

  • .valid?("Apache 2.0 or GPL 3.0") => true
  • .valid?("GPL 3.0+") => true
  • .lookup("GPL 3.0+") => licence
  • .lookup("Apache 2.0 or GPL 3.0") => [licence, licence]
  • .lookup("Apache 2.0", "GPL 3.0") => [licence, licence]
  • .lookup(["Apache 2.0", "GPL 3.0"]) => [licence, licence]

Then perhaps deprecate the single value return value from .lookup for a future version? It would also be nice to be able to parse the and/or in a meaningful way.

👍

@domcleal I wouldn't care about updating lookup to support multiple licenses, but rather that doing the valid proposal

Our use case is over at bevry/staticsitegenerators-list#221