hesa / foss-licenses

License meta information
6 stars 1 forks source link

Don't use scancode_key as aliases #159

Closed hesa closed 4 months ago

hesa commented 4 months ago

Problem Currently x11 gets normalized to ICU

$ flame --verbose license x11
ICU
 * "x11" -> "ICU via "scancode"

This is the case since the scancode_key is automatically added as an alias and for ICU the scancode_key is x11.

Solution In Python: do not look for the scancode_key when identifying the license in JSON license files: add relevant scancode_keys to alias list (e.g. not x11 for ICU)

hesa commented 4 months ago

in the function __identify_license in the file license_db.py, remove

        elif name in self.license_db[SCANCODE_KEYS_TAG]:
            ret_name = self.license_db[SCANCODE_KEYS_TAG][name]
            ret_id = 'scancode_key'