Patchwork package.bbclass: quote pathname given to objdump

login
register
mail settings
Submitter Enrico Scholz
Date Jan. 12, 2012, 4:30 p.m.
Message ID <1326385824-32201-1-git-send-email-enrico.scholz@sigma-chemnitz.de>
Download mbox | patch
Permalink /patch/19177/
State Accepted
Commit 7f7db286ca0b70bd5cce643c3b84f77ad45cc786
Headers show

Comments

Enrico Scholz - Jan. 12, 2012, 4:30 p.m.
Packaging will fail with executable files containing spaces in their
names. Patch quotes the parameter passed to 'objdump'.

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
---
 meta/classes/package.bbclass |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Saul Wold - Jan. 17, 2012, 7:38 p.m.
On 01/12/2012 08:30 AM, Enrico Scholz wrote:
> Packaging will fail with executable files containing spaces in their
> names. Patch quotes the parameter passed to 'objdump'.
>
> Signed-off-by: Enrico Scholz<enrico.scholz@sigma-chemnitz.de>
> ---
>   meta/classes/package.bbclass |    4 ++--
>   1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
> index f8f0a12..1088470 100644
> --- a/meta/classes/package.bbclass
> +++ b/meta/classes/package.bbclass
> @@ -1205,7 +1205,7 @@ SHLIBSDIR = "${STAGING_DIR_HOST}/shlibs"
>   SHLIBSWORKDIR = "${WORKDIR}/shlibs"
>
>   python package_do_shlibs() {
> -	import re
> +	import re, pipes
>
>   	exclude_shlibs = d.getVar('EXCLUDE_FROM_SHLIBS', 0)
>   	if exclude_shlibs:
> @@ -1234,7 +1234,7 @@ python package_do_shlibs() {
>   	lf = bb.utils.lockfile(bb.data.expand("${PACKAGELOCK}", d))
>
>   	def linux_so(root, path, file):
> -		cmd = d.getVar('OBJDUMP', True) + " -p " + os.path.join(root, file) + " 2>/dev/null"
> +		cmd = d.getVar('OBJDUMP', True) + " -p " + pipes.quote(os.path.join(root, file)) + " 2>/dev/null"
>   		cmd = "PATH=\"%s\" %s" % (d.getVar('PATH', True), cmd)
>   		fd = os.popen(cmd)
>   		lines = fd.readlines()

Merged into OE-Core

Thanks	
	Sau!

Patch

diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index f8f0a12..1088470 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -1205,7 +1205,7 @@  SHLIBSDIR = "${STAGING_DIR_HOST}/shlibs"
 SHLIBSWORKDIR = "${WORKDIR}/shlibs"
 
 python package_do_shlibs() {
-	import re
+	import re, pipes
 
 	exclude_shlibs = d.getVar('EXCLUDE_FROM_SHLIBS', 0)
 	if exclude_shlibs:
@@ -1234,7 +1234,7 @@  python package_do_shlibs() {
 	lf = bb.utils.lockfile(bb.data.expand("${PACKAGELOCK}", d))
 
 	def linux_so(root, path, file):
-		cmd = d.getVar('OBJDUMP', True) + " -p " + os.path.join(root, file) + " 2>/dev/null"
+		cmd = d.getVar('OBJDUMP', True) + " -p " + pipes.quote(os.path.join(root, file)) + " 2>/dev/null"
 		cmd = "PATH=\"%s\" %s" % (d.getVar('PATH', True), cmd)
 		fd = os.popen(cmd)
 		lines = fd.readlines()