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

Improve license parsing #279

Merged
merged 5 commits into from
Dec 13, 2020

Conversation

shr-project
Copy link
Contributor

Fixes #271

Corresponding changes for catkin_pkg:
ros-infrastructure/catkin_pkg#296
and rosdistro:
ros/rosdistro#26601

@shr-project shr-project force-pushed the jansa/license branch 6 times, most recently from 579ccb5 to 7db3324 Compare November 6, 2020 04:08
shr-project added a commit to shr-project/meta-ros that referenced this pull request Nov 10, 2020
Regenerate with superflore modified to better parse the license values
as implemented in:
ros-infrastructure/superflore#279

Recipes generated by superflore for all packages in ROS distribution noetic.

This pull request was generated by running the following command:

superflore-gen-oe-recipes --dry-run --no-branch --ros-distro noetic --output-repository-path . --upstream-branch HEAD
shr-project added a commit to shr-project/meta-ros that referenced this pull request Nov 10, 2020
…5146

Regenerate with superflore modified to better parse the license values
as implemented in:
ros-infrastructure/superflore#279

Recipes generated by superflore for all packages in ROS distribution melodic.

This pull request was generated by running the following command:

superflore-gen-oe-recipes --dry-run --no-branch --ros-distro melodic --output-repository-path . --upstream-branch HEAD
shr-project added a commit to shr-project/meta-ros that referenced this pull request Nov 10, 2020
…3600

Regenerate with superflore modified to better parse the license values
as implemented in:
ros-infrastructure/superflore#279

Recipes generated by superflore for all packages in ROS distribution dashing.

This pull request was generated by running the following command:

superflore-gen-oe-recipes --dry-run --no-branch --ros-distro dashing --output-repository-path . --upstream-branch HEAD
shr-project added a commit to shr-project/meta-ros that referenced this pull request Nov 10, 2020
…171906

Regenerate with superflore modified to better parse the license values
as implemented in:
ros-infrastructure/superflore#279

Recipes generated by superflore for all packages in ROS distribution eloquent.

This pull request was generated by running the following command:

superflore-gen-oe-recipes --dry-run --no-branch --ros-distro eloquent --output-repository-path . --upstream-branch HEAD
shr-project added a commit to shr-project/meta-ros that referenced this pull request Nov 10, 2020
Regenerate with superflore modified to better parse the license values
as implemented in:
ros-infrastructure/superflore#279

Recipes generated by superflore for all packages in ROS distribution foxy.

This pull request was generated by running the following command:

superflore-gen-oe-recipes --dry-run --no-branch --ros-distro foxy --output-repository-path . --upstream-branch HEAD
shr-project added a commit to shr-project/meta-ros that referenced this pull request Nov 10, 2020
…5327

Regenerate with superflore modified to better parse the license values
as implemented in:
ros-infrastructure/superflore#279

Recipes generated by superflore for all packages in ROS distribution rolling.

This pull request was generated by running the following command:

superflore-gen-oe-recipes --dry-run --no-branch --ros-distro rolling --output-repository-path . --upstream-branch HEAD
@shr-project shr-project force-pushed the jansa/license branch 4 times, most recently from f7a38ba to 1a60953 Compare November 13, 2020 18:59
shr-project added a commit to shr-project/meta-ros that referenced this pull request Dec 4, 2020
…5146

Regenerate with superflore modified to better parse the license values
as implemented in:
ros-infrastructure/superflore#279

Recipes generated by superflore for all packages in ROS distribution melodic.

This pull request was generated by running the following command:

superflore-gen-oe-recipes --dry-run --no-branch --ros-distro melodic --output-repository-path . --upstream-branch HEAD
shr-project added a commit to shr-project/meta-ros that referenced this pull request Dec 4, 2020
…3600

Regenerate with superflore modified to better parse the license values
as implemented in:
ros-infrastructure/superflore#279

Recipes generated by superflore for all packages in ROS distribution dashing.

This pull request was generated by running the following command:

superflore-gen-oe-recipes --dry-run --no-branch --ros-distro dashing --output-repository-path . --upstream-branch HEAD
shr-project added a commit to shr-project/meta-ros that referenced this pull request Dec 4, 2020
…171906

Regenerate with superflore modified to better parse the license values
as implemented in:
ros-infrastructure/superflore#279

Recipes generated by superflore for all packages in ROS distribution eloquent.

This pull request was generated by running the following command:

superflore-gen-oe-recipes --dry-run --no-branch --ros-distro eloquent --output-repository-path . --upstream-branch HEAD
shr-project added a commit to shr-project/meta-ros that referenced this pull request Dec 4, 2020
Regenerate with superflore modified to better parse the license values
as implemented in:
ros-infrastructure/superflore#279

Recipes generated by superflore for all packages in ROS distribution foxy.

This pull request was generated by running the following command:

superflore-gen-oe-recipes --dry-run --no-branch --ros-distro foxy --output-repository-path . --upstream-branch HEAD
shr-project added a commit to shr-project/meta-ros that referenced this pull request Dec 4, 2020
…5327

Regenerate with superflore modified to better parse the license values
as implemented in:
ros-infrastructure/superflore#279

Recipes generated by superflore for all packages in ROS distribution rolling.

This pull request was generated by running the following command:

superflore-gen-oe-recipes --dry-run --no-branch --ros-distro rolling --output-repository-path . --upstream-branch HEAD
@shr-project shr-project force-pushed the jansa/license branch 2 times, most recently from 9852b10 to 34b5f21 Compare December 5, 2020 12:16
shr-project added a commit to ros/meta-ros that referenced this pull request Dec 10, 2020
…5327

Regenerate with superflore modified to better parse the license values
as implemented in:
ros-infrastructure/superflore#279

Recipes generated by superflore for all packages in ROS distribution rolling.

This pull request was generated by running the following command:

superflore-gen-oe-recipes --dry-run --no-branch --ros-distro rolling --output-repository-path . --upstream-branch HEAD
shr-project added a commit to ros/meta-ros that referenced this pull request Dec 10, 2020
…5146

Regenerate with superflore modified to better parse the license values
as implemented in:
ros-infrastructure/superflore#279

Recipes generated by superflore for all packages in ROS distribution melodic.

This pull request was generated by running the following command:

superflore-gen-oe-recipes --dry-run --no-branch --ros-distro melodic --output-repository-path . --upstream-branch HEAD

Signed-off-by: Martin Jansa <[email protected]>
shr-project added a commit to ros/meta-ros that referenced this pull request Dec 10, 2020
…3600

Regenerate with superflore modified to better parse the license values
as implemented in:
ros-infrastructure/superflore#279

Recipes generated by superflore for all packages in ROS distribution dashing.

This pull request was generated by running the following command:

superflore-gen-oe-recipes --dry-run --no-branch --ros-distro dashing --output-repository-path . --upstream-branch HEAD

Signed-off-by: Martin Jansa <[email protected]>
shr-project added a commit to ros/meta-ros that referenced this pull request Dec 10, 2020
…171906

Regenerate with superflore modified to better parse the license values
as implemented in:
ros-infrastructure/superflore#279

Recipes generated by superflore for all packages in ROS distribution eloquent.

This pull request was generated by running the following command:

superflore-gen-oe-recipes --dry-run --no-branch --ros-distro eloquent --output-repository-path . --upstream-branch HEAD

Signed-off-by: Martin Jansa <[email protected]>
shr-project added a commit to ros/meta-ros that referenced this pull request Dec 10, 2020
Regenerate with superflore modified to better parse the license values
as implemented in:
ros-infrastructure/superflore#279

Recipes generated by superflore for all packages in ROS distribution foxy.

This pull request was generated by running the following command:

superflore-gen-oe-recipes --dry-run --no-branch --ros-distro foxy --output-repository-path . --upstream-branch HEAD

Signed-off-by: Martin Jansa <[email protected]>
shr-project added a commit to ros/meta-ros that referenced this pull request Dec 10, 2020
…5327

Regenerate with superflore modified to better parse the license values
as implemented in:
ros-infrastructure/superflore#279

Recipes generated by superflore for all packages in ROS distribution rolling.

This pull request was generated by running the following command:

superflore-gen-oe-recipes --dry-run --no-branch --ros-distro rolling --output-repository-path . --upstream-branch HEAD
"zlib-acknowledgement",
"ZPL-1.1",
"ZPL-2.0",
"ZPL-2.1"]
Copy link
Collaborator

Choose a reason for hiding this comment

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

👀 @shr-project wow, that's got to be all of them now.

allenh1
allenh1 previously approved these changes Dec 10, 2020
Copy link
Collaborator

@allenh1 allenh1 left a comment

Choose a reason for hiding this comment

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

@shr-project this is above and beyond what I was looking for. Thanks a million! 👍 from me.

@allenh1
Copy link
Collaborator

allenh1 commented Dec 10, 2020

@shr-project In which order should I merge #279, #280, #281?

Let me know and I'll start hitting merge buttons. :)

@shr-project
Copy link
Contributor Author

@shr-project In which order should I merge #279, #280, #281?

Let me know and I'll start hitting merge buttons. :)

#281, #280, #279 :)

herb-kuta-lge
herb-kuta-lge previously approved these changes Dec 10, 2020
@shr-project
Copy link
Contributor Author

Please DON'T SQUASH the commits when merging, it will be impossible to review and understand the commits after they are squashed.

@shr-project shr-project force-pushed the jansa/license branch 3 times, most recently from cfb2d70 to 4d9fa14 Compare December 11, 2020 15:54
herb-kuta-lge
herb-kuta-lge previously approved these changes Dec 12, 2020
* instead of trying to guess what the owner meant
* exact string replacements are safer than parsing with regular expressions
  because the license value is often quite creative

* these statistics from old regexp implementation are just from regenerated melodic recipes:
  A) clearly wrong replacements
      1 "BSD & CreativeCommons-by-nc-4.0" -> "BSD & CC-BY-SA-3.0"
      1 "BSD & GPLv3 & LGPLv3" -> "BSD & GPL-3 & LGPL-2"
      1 "BSD,-Apache-2.0" -> "BSD-2"
      1 "CreativeCommons-Attribution-NonCommercial-ShareAlike-4.0-International" -> "CC-BY-SA-3.0"
      1 "LGPL3" -> "LGPL-2"
      2 "Creative-Commons-BY-NC-ND-3.0" -> "CC-BY-NC-ND-4.0"
      4 "GPLv3 & LGPLv3 & BSD" -> "GPL-3 & LGPL-2 & BSD"
     17 "GPLv3" -> "GPL-3"
     21 "LGPLv3" -> "LGPL-2"

  B) not clearly wrong, but guessing too much about version and often incorrectly
     (after inspection of the actual source files)
      1 "Apache-License-2.0 & LGPL" -> "Apache-2.0 & LGPL-2"
      1 "BSD & LGPL & GPL-for-sigblock" -> "BSD & LGPL-2 & GPL-1"
      1 "LGPL & proprietary" -> "LGPL-2 & proprietary"
      2 "BSD & Creative-Commons" -> "BSD & CC-BY-SA-3.0"
      4 "Apache" -> "Apache-1.0"
      5 "GNU-Lesser-General-Public-License-LGPL-" -> "LGPL-2"
     15 "GPL" -> "GPL-1"
     23 "LGPL" -> "LGPL-2"

* and in some cases it was loosing some useful information:
      1 "BSD,-Apache-2.0" -> "BSD-2"
      1 "BSD,-LGPL" -> "BSD"
      1 "BSD,-some-icons-are-licensed-under-the-GNU-Lesser-General-Public-License-LGPL-or-Creative-Commons-Attribution-Noncommercial-3.0-License" -> "BSD"
      1 "BSD,GPL-because-of-list.h;-other-files-released-under-BSD,GPL" -> "BSD"
      1 "BSD,LGPL,Apache-2.0" -> "BSD-2"
      1 "BSD,LGPL,LGPL-amcl-" -> "BSD"
      1 "GPL-because-of-list.h;-other-files-released-under-BSD" -> "GPL-1"
      1 "GPLv2-with-linking-exception" -> "GPL-2"
      2 "BSD,-GPL" -> "BSD"
      8 "BSD-3-Clause" -> "BSD"

* fixes:
  ros-infrastructure#271
* 'Apache' doesn't always mean version 1 in 'Apache-1.0'
* 'GPL' doesn't always mean version 1 in 'GPL-1'
* 'Mozilla Public License' doesn't always mean version 2.0 in 'MPL-2.0'
* 'BSD License 2.0' doesn't always mean clause-2 in 'BSD-2'
* 'Creative Commons' doesn't always mean Creative Commons Attribution Share Alike 3.0 in 'CC-BY-SA-3.0'

* to be safe leave the orignal value and catkin_pkg package.xml validation
  will hopefully notify component developer to better specify the version
  based on the real source files - instead of superflore guessing what was
  meant by that

* fixes:
  ros-infrastructure#271

Signed-off-by: Martin Jansa <[email protected]>
…t original value in comment

* print the original value from package.xml whenever
  the get_license function modified, this makes it easier to review
  what superflore did in the recipe and makes some more
  creative values more readable

  e.g.
  "HEBI C++ Software License (https://www.hebirobotics.com/softwarelicense)"
  instead of:
  "HEBI-C-Software-License-https-www.hebirobotics.com-softwarelicense-"

  or "N/A" instead of "N-A"

Signed-off-by: Martin Jansa <[email protected]>
* replace spaces with dashes in these 4 cases which weren't mapped to
  valid SPDX (which would be without spaces)

Signed-off-by: Martin Jansa <[email protected]>
@herb-kuta-lge
Copy link
Contributor

@allenh1 Even though this PR affects more than the OpenEmbedded portions of the code, since you've already approved it, I'm going to merge it.

@herb-kuta-lge herb-kuta-lge merged commit 4105ad8 into ros-infrastructure:master Dec 13, 2020
@shr-project shr-project deleted the jansa/license branch December 14, 2020 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

License parsing doesn't parse e.g. LGPLv3 correctly
3 participants