mirror of
https://git.yoctoproject.org/poky
synced 2026-06-03 13:49:49 +00:00
package.py: use subprocess.Popen for rpmdeps call
* I've noticed errors like this in log.do_package:
DEBUG: Executing python function package_do_filedeps
sh: 1: Syntax error: "(" unexpected
sh: 1: Syntax error: "(" unexpected
DEBUG: Python function package_do_filedeps finished
which are actually caused by some filenames included in package
containing '()' characters
Maybe we should change meta/classes/package.bbclass to
fail when some filedeprunner call fails like this and fix
filedeprunner to escape '()' and other possibly dangerous chars
it's called like this:
processed = list(pool.imap(oe.package.filedeprunner, pkglist))
* don't use shell=True
* show the command when it fails and let do_package task to fail
(From OE-Core rev: 148c04c1bf39ca0d21288fdce61c51dc8e1c3226)
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
d31d2e85cf
commit
ff8d8fbc9e
@@ -54,7 +54,7 @@ def file_translate(file):
|
||||
return ft
|
||||
|
||||
def filedeprunner(arg):
|
||||
import re
|
||||
import re, subprocess, shlex
|
||||
|
||||
(pkg, pkgfiles, rpmdeps, pkgdest) = arg
|
||||
provides = {}
|
||||
@@ -89,8 +89,11 @@ def filedeprunner(arg):
|
||||
|
||||
return provides, requires
|
||||
|
||||
dep_pipe = os.popen(rpmdeps + " " + " ".join(pkgfiles))
|
||||
|
||||
provides, requires = process_deps(dep_pipe, pkg, pkgdest, provides, requires)
|
||||
try:
|
||||
dep_popen = subprocess.Popen(shlex.split(rpmdeps) + pkgfiles, stdout=subprocess.PIPE)
|
||||
provides, requires = process_deps(dep_popen.stdout, pkg, pkgdest, provides, requires)
|
||||
except OSError as e:
|
||||
bb.error("rpmdeps: '%s' command failed, '%s'" % (shlex.split(rpmdeps) + pkgfiles, e))
|
||||
raise e
|
||||
|
||||
return (pkg, provides, requires)
|
||||
|
||||
Reference in New Issue
Block a user