]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commit
classes-recipe/multilib_script: Expand before splitting
authorJoshua Watt <JPEWhacker@gmail.com>
Mon, 15 Jul 2024 21:52:12 +0000 (15:52 -0600)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Thu, 18 Jul 2024 16:19:03 +0000 (17:19 +0100)
commitb9c992e69f3f44051610386ce4f743e224750694
tree6ca597927c8af13bafb602a9c769d6989092d7f2
parent47b838eea7e3684d6b00bb7196313f0bfa519aba
classes-recipe/multilib_script: Expand before splitting

multilib_script.bbclass was unable to work correctly in the case where
e.g. a PACKAGECONFIG removed the script that it was intended to rename
(as an example, the "trace" PACKAGECONFIG in cairo). The way to fix this
would be to do something like:

 MULTILIB_SCRIPTS = "${@bb.utils.contains('PACKAGECONFIG', 'trace', '${PN}-perf-utils:${bindir}/cairo-trace', '', d)}"

but this is not possible because the variable is not expanded before
being split.

To fix this, change the class to expand the variable before splitting.
There are two cases to be considered that could possibly break:
 1) If the RHS of the ":" contains a ":", which is accounted for by
    limiting the splitting to 1 split, which will leave the ":" in the
    RHS in tact. Of note, this works because ":" isn't valid in a
    package name
 2) If the RHS of the ":" contained whitespace, however this would have
    broken the mv command written to multilibscript_rename(), so this
    isn't occurring in practice.

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/classes-recipe/multilib_script.bbclass