[OE-core] [PATCH 3/3] rpm: Generate per distribution and multilib macro files

Richard Purdie richard.purdie at linuxfoundation.org
Tue Jun 23 14:57:55 UTC 2015


On Wed, 2015-06-17 at 12:04 -0500, Mark Hatle wrote:
> The distribution and multilib macro files are required for rpmbuild, on the
> target, to work properly.  These override the default settings from the
> upstream macro files with the proper values for the OE configuration.
> 
> Signed-off-by: Mark Hatle <mark.hatle at windriver.com>
[...]
> +def multilib_rpmmacros(d):
> +    localdata = d.createCopy()
> +    # We need to clear the TOOLCHAIN_OPTIONS (--sysroot)
> +    localdata.delVar('TOOLCHAIN_OPTIONS')
> +
> +    # Set it to the consistent of 'd'.
> +    localdata.setVar('distromacrodir', d.getVar('distromacrodir', True))
> +    localdata.setVar('WORKDIR', d.getVar('WORKDIR', True))
> +
> +    ret = gen_arch_macro(localdata)
> +
> +    variants = d.getVar("MULTILIB_VARIANTS", True) or ""
> +    for item in variants.split():
> +        # Load overrides from 'd' to avoid having to reset the value...
> +        overrides = d.getVar("OVERRIDES", False) + ":virtclass-multilib-" + item
> +        localdata.setVar("OVERRIDES", overrides)
> +        localdata.setVar("MLPREFIX", item + "-")
> +        bb.data.update_data(localdata)
> +        ret += gen_arch_macro(localdata)
> +    return ret

This doesn't look right. Usually there should be a loop of the form:

for x in y:
    localdata = d.createCopy()
    overrides = d.getVar("OVERRIDES", False) + f(x)
    localdata.setVar("OVERRIDES", overrides)
    bb.data.update_data(localdata)

where overrides is modified in the copy. If you don't do this, the
overrides will continue to be applied in the datastore with the way the
datastore currently works. This may happen to work but won't be correct.

As it happens, the datastore changes I've proposed will handle this
better but right now, the code above doesn't do what I think you'd want
it too. If its been copied from somewhere, that source also likely needs
fixing.

Cheers,

Richard





More information about the Openembedded-core mailing list