Commits on Mar 8, 2023

  1. brackets in spdx license expression rejected by as_is_spdx_license_ex…

    …pression
    
    something like: "CC0-1.0 AND (BSD-3-Clause OR LGPL-2.1-only)"
    is reported by appstreamcli check-license as "invalid" and not "Free and
    Open Source"
    
    $ appstreamcli check-license "CC0-1.0 AND (BSD-3-Clause OR LGPL-2.1-only)"
    License Type: invalid
    Suitable for AppStream metadata: no
    Free and Open Source: no
    
    Trying to debug I find that "as_license_is_free_license" accepts this
    string as valid, but that "as_is_spdx_license_expression" considers
    it invalid due to the presence of "(" and ")" so it is rejected there
    and so ascli_check_license goes on to use as_license_to_spdx_id which
    turns it into "CC0-1.0-1.0 AND (BSD-3-Clause-3-Clause OR LGPL-2.1-only)"
    ascli_check_license is ok with brackets, but at this point its mangled
    and understandably fails.
    
    In fedora in practice I see gnome-software designate libreoffice
    langpacks as "Proprietary Code" when a similar license tag is extracted
    from the rpm and propogated into appstream.
    
    https://bugs.documentfoundation.org/show_bug.cgi?id=154056
    caolanm committed Mar 8, 2023