diff options
author | Martin Jansa <martin.jansa@gmail.com> | 2023-09-27 12:48:18 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-09-28 12:37:47 +0100 |
commit | 9e8b56994d53096e87ed472f1ebe68faa36628c3 (patch) | |
tree | 9b5c44cefaa2af3127f661f95d2bd6fe8773cdea /meta/classes-recipe/multilib_script.bbclass | |
parent | 83b4083fdc15c39fe2a4527ea8f1c0d88001cc40 (diff) | |
download | poky-9e8b56994d53096e87ed472f1ebe68faa36628c3.tar.gz |
multilib_script.bbclass: expand script name as well
* e.g. mozjs from meta-oe contains major version from PV in the script name
but currently cannot use a variable there because it would be unexpanded
in the varflag name as shown in bitbake -e (lib32-curl included for comparison)
env.lib32-curl:# $ALTERNATIVE_TARGET [2 operations]
env.lib32-curl-# set oe-core/meta/conf/documentation.conf:66
env.lib32-curl-# [doc] "Used by the alternatives system to create default link locations for duplicated commands."
env.lib32-curl-# set multilib_script.bbclass:37 [__anon_40_oe_core_meta_classes_recipe_multilib_script_bbclass]
env.lib32-curl-# [curl-config] "${bindir}/curl-config-${MULTILIB_SUFFIX}"
env.lib32-curl-# pre-expansion value:
env.lib32-curl-# "None"
--
env.lib32-mozjs-115:# $ALTERNATIVE_TARGET [2 operations]
env.lib32-mozjs-115-# set oe-core/meta/conf/documentation.conf:66
env.lib32-mozjs-115-# [doc] "Used by the alternatives system to create default link locations for duplicated commands."
env.lib32-mozjs-115-# set multilib_script.bbclass:37 [__anon_40_oe_core_meta_classes_recipe_multilib_script_bbclass]
env.lib32-mozjs-115-# [js${MAJ_VER}-config] "${bindir}/js${MAJ_VER}-config-${MULTILIB_SUFFIX}"
env.lib32-mozjs-115-# pre-expansion value:
env.lib32-mozjs-115-# "None"
--
env.lib32-mozjs-115-escript:# $ALTERNATIVE_TARGET [2 operations]
env.lib32-mozjs-115-escript-# set oe-core/meta/conf/documentation.conf:66
env.lib32-mozjs-115-escript-# [doc] "Used by the alternatives system to create default link locations for duplicated commands."
env.lib32-mozjs-115-escript-# set multilib_script.bbclass:38 [__anon_41_oe_core_meta_classes_recipe_multilib_script_bbclass]
env.lib32-mozjs-115-escript-# [js115-config] "/usr/bin/js115-config-${MULTILIB_SUFFIX}"
env.lib32-mozjs-115-escript-# pre-expansion value:
env.lib32-mozjs-115-escript-# "None"
Otherwise log.do_package shows that apply_update_alternative_renames first
renames the js115-config to js115-config.mozjs-115 (default ALTERNATIVE_TARGET suffix is '.${BPN}')
and multilibscript_rename later fails:
DEBUG: Executing python function apply_update_alternative_renames
NOTE: mozjs-115: Rename /usr/bin/js115-config -> /usr/bin/js115-config.mozjs-115
DEBUG: Python function apply_update_alternative_renames finished
DEBUG: Executing shell function multilibscript_rename
mv: cannot stat 'BUILD/work/mach-oemllib32-linux-gnueabi/lib32-mozjs-115/115.2.0/package/usr/bin/js115-config': No such file or directory
WARNING: exit code 1 from a shell command.
I wonder if we actually need multilibscript_rename as apply_update_alternative_renames seems
to do the rename already.
(From OE-Core rev: d07bfddba023a1c92491b261c9f9c25ec1a0ef57)
Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes-recipe/multilib_script.bbclass')
-rw-r--r-- | meta/classes-recipe/multilib_script.bbclass | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/meta/classes-recipe/multilib_script.bbclass b/meta/classes-recipe/multilib_script.bbclass index 7011526254..e6f0249529 100644 --- a/meta/classes-recipe/multilib_script.bbclass +++ b/meta/classes-recipe/multilib_script.bbclass | |||
@@ -31,10 +31,11 @@ python () { | |||
31 | for entry in (d.getVar("MULTILIB_SCRIPTS", False) or "").split(): | 31 | for entry in (d.getVar("MULTILIB_SCRIPTS", False) or "").split(): |
32 | pkg, script = entry.split(":") | 32 | pkg, script = entry.split(":") |
33 | epkg = d.expand(pkg) | 33 | epkg = d.expand(pkg) |
34 | scriptname = os.path.basename(script) | 34 | escript = d.expand(script) |
35 | scriptname = os.path.basename(escript) | ||
35 | d.appendVar("ALTERNATIVE:" + epkg, " " + scriptname + " ") | 36 | d.appendVar("ALTERNATIVE:" + epkg, " " + scriptname + " ") |
36 | d.setVarFlag("ALTERNATIVE_LINK_NAME", scriptname, script) | 37 | d.setVarFlag("ALTERNATIVE_LINK_NAME", scriptname, escript) |
37 | d.setVarFlag("ALTERNATIVE_TARGET", scriptname, script + "-${MULTILIB_SUFFIX}") | 38 | d.setVarFlag("ALTERNATIVE_TARGET", scriptname, escript + "-${MULTILIB_SUFFIX}") |
38 | d.appendVar("multilibscript_rename", "\n mv ${PKGD}" + script + " ${PKGD}" + script + "-${MULTILIB_SUFFIX}") | 39 | d.appendVar("multilibscript_rename", "\n mv ${PKGD}" + escript + " ${PKGD}" + escript + "-${MULTILIB_SUFFIX}") |
39 | d.appendVar("FILES:" + epkg, " " + script + "-${MULTILIB_SUFFIX}") | 40 | d.appendVar("FILES:" + epkg, " " + escript + "-${MULTILIB_SUFFIX}") |
40 | } | 41 | } |