I would like to run attrib with custom template, so it would print all licenses along with their ids.
Something like that:
{% for i in range(about_object.license_file.value|length) %}
<h2>{{ about_object.license_key.value[i] | e}}</h2>
<pre>{{ about_object.license_file.value.values()[i] | e}}</pre>
{% endfor %}
The problem is that license_key field doesn't keep its order from ABOUT file.
Given ABOUT file:
...
license_expression: LGPL-3.0-or-later OR Apache-2.0
licenses:
- key: Apache-2.0
name: Apache License 2.0
file: LICENSES/Apache-2.0.txt
- key: LGPL-3.0-or-later
name: LGPL
file: LICENSES/LGPL-3.0.txt
I got the incorrect results, Apache text named LGPL and vice versa.
The problem seems to be here:
https://github.com/nexB/aboutcode-toolkit/blob/57dc7455874f2d878cdbc7bd6369c676e2ee8e7f/src/attributecode/model.py#L1091
License keys are just overridden, and files are not processed at all.
I would like to run
attribwith custom template, so it would print all licenses along with their ids.Something like that:
The problem is that
license_keyfield doesn't keep its order from ABOUT file.Given ABOUT file:
I got the incorrect results, Apache text named LGPL and vice versa.
The problem seems to be here:
https://github.com/nexB/aboutcode-toolkit/blob/57dc7455874f2d878cdbc7bd6369c676e2ee8e7f/src/attributecode/model.py#L1091
License keys are just overridden, and files are not processed at all.