On Wed, 4 Sep 2019 at 09:32, Quentin Schulz <quentin.schulz@streamunlimited.com> wrote:
> +++ b/meta/classes/package.bbclass
> @@ -1646,7 +1646,8 @@ python package_do_shlibs() {
>                  prov = (this_soname, ldir, pkgver)
>                  if not prov in sonames:
>                      # if library is private (only used by package) then do not build shlib for it
> -                    if not private_libs or this_soname not in private_libs:
> +                    import fnmatch
> +                    if not private_libs or len([i for i in private_libs if fnmatch.fnmatch(this_soname, i)]) == 0:

We only need to know if this_soname is matching one of the patterns, we
don't need to check for each and every pattern.

Something like:

for pattern in private_libs:
        if fnmatch.fnmatch(this_soname, pattern)]) == 0:
                sonames.add(prov)
                break

would be possible?

Actually, this suggested code snippet looks altogether wrong to me. We do need to check the file against every pattern, and only if it matches none of them, it gets added to sonames. Note the original code says 'this_soname not in private_libs', which also means going over every item in the list.

Alex