Skip to contentSkip to conversation

multilib_script: fix whitespace

PATCH In review Ross Burton 2 participants 4 messages Jul 2, 2019 – Jul 3, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 multilib_script: fix whitespace

The blocks were intended with 3 spaces instead of 4.

---
 meta/classes/multilib_script.bbclass | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
meta/classes/multilib_script.bbclass +10 -10
index dc166d06c17..b11efc1ec5c 100644
@@ -17,18 +17,18 @@ multilibscript_rename() {
 python () {
     # Do nothing if multilib isn't being used
     if not d.getVar("MULTILIB_VARIANTS"):
-       return
+        return
     # Do nothing for native/cross
     if bb.data.inherits_class('native', d) or bb.data.inherits_class('cross', d):
-       return
+        return
 
     for entry in (d.getVar("MULTILIB_SCRIPTS", False) or "").split():
-       pkg, script = entry.split(":")
-       epkg = d.expand(pkg)
-       scriptname = os.path.basename(script)
-       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}")
+        pkg, script = entry.split(":")
+        epkg = d.expand(pkg)
+        scriptname = os.path.basename(script)
+        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}")
 }
Signature · 1 line
2.11.0
#1 lore raw

PATCH 2/2 multilib_script: use MLPREFIX instead of libdir when renaming

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.

---
 meta/classes/multilib_script.bbclass | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)
meta/classes/multilib_script.bbclass +4 -5
index b11efc1ec5c..de95dc6551d 100644
@@ -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)
 }
Signature · 1 line
2.11.0
#2 lore raw

Re: [PATCH 2/2] multilib_script: use MLPREFIX instead of libdir when renaming

Quoted 11 lines · Ross Burton

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.

---
 meta/classes/multilib_script.bbclass | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

This appears to have some issues:

https://autobuilder.yoctoproject.org/typhoon/#/builders/44/builds/794

Cheers,

Richard

#3 lore raw

Re: [PATCH 2/2] multilib_script: use MLPREFIX instead of libdir when renaming

Yeah discovered that late last night here too. V2 finalising now.

Ross

Quoted 22 lines · Richard Purdie
Quoted 11 lines · Ross Burton

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.

---
 meta/classes/multilib_script.bbclass | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

This appears to have some issues:

https://autobuilder.yoctoproject.org/typhoon/#/builders/44/builds/794

Cheers,

Richard