[OE-core] [PATCH] utils.py: added sh_quote() function

Enrico Scholz enrico.scholz at sigma-chemnitz.de
Wed Apr 3 15:41:31 UTC 2019


This function is a wrapper around "shlex.quote()" and can be used in
"${@...}" context where shlex (or pipes, which provides similar
functionality) is unavailable.

Signed-off-by: Enrico Scholz <enrico.scholz at sigma-chemnitz.de>
---
 meta/lib/oe/utils.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
index 3a496090f3..cedd053d36 100644
--- a/meta/lib/oe/utils.py
+++ b/meta/lib/oe/utils.py
@@ -490,3 +490,6 @@ class ImageQAFailed(bb.build.FuncFailed):
 
         return msg
 
+def sh_quote(string):
+    import shlex
+    return shlex.quote(string)
-- 
2.20.1



More information about the Openembedded-core mailing list