[OE-core] [PATCH 2/2] multilib_script: use MLPREFIX instead of libdir when renaming

Ross Burton ross.burton at intel.com
Tue Jul 2 15:22:48 UTC 2019


Instead of using part of ${base_libdir} to rename scripts, use MLPREFIX.  This
is more obvious as MLPREFIX is a common prefix in package names, and as these
filenames are hidden behind alternatives they're rarely used directly.

Signed-off-by: Ross Burton <ross.burton at intel.com>
---
 meta/classes/multilib_script.bbclass | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/meta/classes/multilib_script.bbclass b/meta/classes/multilib_script.bbclass
index b11efc1ec5c..de95dc6551d 100644
--- a/meta/classes/multilib_script.bbclass
+++ b/meta/classes/multilib_script.bbclass
@@ -6,8 +6,6 @@
 
 inherit update-alternatives
 
-MULTILIB_SUFFIX = "${@d.getVar('base_libdir',1).split('/')[-1]}"
-
 PACKAGE_PREPROCESS_FUNCS += "multilibscript_rename"
 
 multilibscript_rename() {
@@ -26,9 +24,10 @@ python () {
         pkg, script = entry.split(":")
         epkg = d.expand(pkg)
         scriptname = os.path.basename(script)
+        mlname = os.path.join(os.path.dirname(script), "${MLPREFIX}" + scriptname)
         d.appendVar("ALTERNATIVE_" + epkg, " " + scriptname + " ")
         d.setVarFlag("ALTERNATIVE_LINK_NAME", scriptname, script)
-        d.setVarFlag("ALTERNATIVE_TARGET", scriptname, script + "-${MULTILIB_SUFFIX}")
-        d.appendVar("multilibscript_rename",  "\n	mv ${PKGD}" + script + " ${PKGD}" + script + "-${MULTILIB_SUFFIX}")
-        d.appendVar("FILES_" + epkg, " " + script + "-${MULTILIB_SUFFIX}")
+        d.setVarFlag("ALTERNATIVE_TARGET", scriptname, mlname)
+        d.appendVar("FILES_" + epkg, " " + mlname)
+        d.appendVar("multilibscript_rename",  "\n	mv ${PKGD}" + script + " ${PKGD}" + mlname)
 }
-- 
2.11.0



More information about the Openembedded-core mailing list