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

Do not collect expanded detected license texts on binaries #2226

Closed
pombredanne opened this issue Sep 11, 2020 · 0 comments · Fixed by #2227
Closed

Do not collect expanded detected license texts on binaries #2226

pombredanne opened this issue Sep 11, 2020 · 0 comments · Fixed by #2227

Comments

@pombredanne
Copy link
Member

For gosu binaries, and this license text: license: GPL-3 (full text at https://github.com/tianon/gosu), and $ scancode -l --license-text gosu --json-pp - we get this long (truncated here for brevity) "junk":

"files": [
    {
      "path": "gosu",
      "type": "file",
      "licenses": [
        {
          "key": "gpl-3.0",
          "score": 16.0,
          "name": "GNU General Public License 3.0",
          "short_name": "GPL 3.0",
          "category": "Copyleft",
          "is_exception": false,
          "owner": "Free Software Foundation (FSF)",
          "homepage_url": "http://www.gnu.org/licenses/gpl-3.0.html",
          "text_url": "http://www.gnu.org/licenses/gpl-3.0-standalone.html",
          "reference_url": "https://enterprise.dejacode.com/urn/urn:dje:license:gpl-3.0",
          "spdx_license_key": "GPL-3.0-only",
          "spdx_url": "https://spdx.org/licenses/GPL-3.0-only",
          "start_line": 3980,
          "end_line": 3980,
          "matched_rule": {
            "identifier": "gpl-3.0_rdesc_1.RULE",
            "license_expression": "gpl-3.0",
            "licenses": [
              "gpl-3.0"
            ],
            "is_license_text": false,
            "is_license_notice": false,
            "is_license_reference": false,
            "is_license_tag": true,
            "matcher": "2-aho",
            "rule_length": 3,
            "matched_length": 3,
            "match_coverage": 100.0,
            "rule_relevance": 16
          },
          "matched_text": "> (den<<shift)/2unsupported compression for {{%s %s}}%s{{else}}%s{{end}} cannot be converted to type 45474735088646411895751953125LockOSThread nesting overflowSIGPIPE: write to broken pipeSIGPWR: power failure restartTime.UnmarshalBinary: no dataaddspecial on invalid pointerbufio.Scanner: token too longcannot 3-index slice a stringexecuting on Go runtime stackgc done but gcphase != _GCoffgfput: bad status (not Gdead)invalid length of trace eventio: 
.
.
.
8495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899\nUsage: {{ .Self }} user-spec command [args]\n   eg: {{ .Self }} tianon bash\n       {{ .Self }} nobody:root bash -c 'whoami && id'\n       {{ .Self }} 1000:1 id\n\n{{ .Self }} version: {{ .Version }}\n{{ .Self }} license: GPL-3 (full text at https://github.com/tianon/gosu)"
        }
      ],
      "license_expressions": [
        "gpl-3.0"
      ],
      "percentage_of_license_text": 0.01,
      "scan_errors": []
    }
  ]
}



pombredanne added a commit that referenced this issue Sep 11, 2020
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
pombredanne added a commit that referenced this issue Sep 11, 2020
Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
pombredanne added a commit that referenced this issue Nov 17, 2020
This partially reverts changes from #2226

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
pombredanne added a commit that referenced this issue Nov 17, 2020
With this change, the literal \\r CR and \\n LF at the end of a line are
removed. Also text is split in lines.

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
pombredanne added a commit that referenced this issue Nov 17, 2020
With this we can now validate that we can collect matced texts in
binaries correctly without significant regression with #2226

Signed-off-by: Philippe Ombredanne <pombredanne@nexb.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant