On Sat, 2026-02-07 at 00:28 +0000, Johannes Schneider wrote:
> Add 'expand=True' to directly resolve file checksums that are added
> conditionally with inline python code.
> 
> Otherwise it can happend that the license.bbclass still sees the
> un-expanded values and either misses or even skipps adjacent licenses.
> 
> E.g. an unvaforable combination of
> LIC_FILES_CHKSUM += 
> "file://docs/license.rst;md5=83b7626b8c7a37263c6a58af8d19bee1"
> LIC_FILES_CHKSUM:append = "${@bb.utils.contains('TFA_MBEDTLS', '1', ' 
> ${LIC_FILES_CHKSUM_MBEDTLS}', '', d)}"
> 
> would lead to a
>  # pre-expansion value:
>  #   " 
> file://docs/license.rst;md5=83b7626b8c7a37263c6a58af8d19bee1${@bb.utils.contains('TFA_MBEDTLS',
>  '1', ' ${LIC_FILES_CHKSUM_MBEDTLS}', '', d)}"
>  LIC_FILES_CHKSUM=" 
> file://docs/license.rst;md5=83b7626b8c7a37263c6a58af8d19bee1"
> and the license checksum verification on 'license.rst' being sometimes 
> skipped.
> 
> Signed-off-by: Johannes Schneider <[email protected]>
> ---
>  meta/classes-global/license.bbclass | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/classes-global/license.bbclass 
> b/meta/classes-global/license.bbclass
> index af5f1ed41d..62116ba31d 100644
> --- a/meta/classes-global/license.bbclass
> +++ b/meta/classes-global/license.bbclass
> @@ -125,7 +125,7 @@ def find_license_files(d):
>      from collections import defaultdict, OrderedDict
>  
>      # All the license files for the package
> -    lic_files = d.getVar('LIC_FILES_CHKSUM') or ""
> +    lic_files = d.getVar('LIC_FILES_CHKSUM', expand=True) or ""
>      pn = d.getVar('PN')
>      # The license files are located in S/LIC_FILE_CHECKSUM.
>      srcdir = d.getVar('S')

This is a little strange as expand has been the default value for a
long time. On a modern code base, this should therefore be the default
and the change would make no difference. 

Was this an issue you were seeing on an older release?

Cheers,

Richard
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#230668): 
https://lists.openembedded.org/g/openembedded-core/message/230668
Mute This Topic: https://lists.openembedded.org/mt/117682470/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to