aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndré Draszik <andre.draszik@jci.com>2019-01-16 10:12:38 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-01-16 11:08:18 +0000
commit539f65d2533a277233d83d085cb78bdf56a6e16c (patch)
treef40673e78cfd9b0d1bb32eaf3f42a355860761ef
parent37cb293cf0f4194ec923d3bc4ebb9645f07536c0 (diff)
downloadopenembedded-core-539f65d2533a277233d83d085cb78bdf56a6e16c.tar.gz
openembedded-core-539f65d2533a277233d83d085cb78bdf56a6e16c.tar.bz2
openembedded-core-539f65d2533a277233d83d085cb78bdf56a6e16c.zip
classes/compress_doc: add missing import subprocess
Enabling compress_doc gives the following stack trace: File: 'exec_python_func() autogenerated', lineno: 2, function: <module> 0001: *** 0002:package_do_compress_doc(d) 0003: File: '/scratch/yocto/swupd.bb/poky/meta/classes/compress_doc.bbclass', lineno: 50, function: package_do_compress_doc 0046: mandir = os.path.abspath(dvar + os.sep + d.getVar("mandir")) 0047: if os.path.exists(mandir): 0048: # Decompress doc files which format is not compress_mode 0049: decompress_doc(mandir, compress_mode, decompress_cmds) *** 0050: compress_doc(mandir, compress_mode, compress_cmds) 0051: 0052: infodir = os.path.abspath(dvar + os.sep + d.getVar("infodir")) 0053: if os.path.exists(infodir): 0054: # Decompress doc files which format is not compress_mode File: '/scratch/yocto/swupd.bb/poky/meta/classes/compress_doc.bbclass', lineno: 180, function: compress_doc 0176: _collect_hardlink(hardlink_dict, file) 0177: # Normal file 0178: elif os.path.isfile(file): 0179: cmd = "%s %s" % (compress_cmds[compress_mode], file) *** 0180: (retval, output) = subprocess.getstatusoutput(cmd) 0181: if retval: 0182: bb.warn("compress failed %s (cmd was %s)%s" % (retval, cmd, ":\n%s" % output if output else "")) 0183: continue 0184: bb.note('compress file %s' % file) Exception: NameError: name 'subprocess' is not defined Fix by adding the missing import in two places. Signed-off-by: André Draszik <andre.draszik@jci.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/compress_doc.bbclass2
1 files changed, 2 insertions, 0 deletions
diff --git a/meta/classes/compress_doc.bbclass b/meta/classes/compress_doc.bbclass
index 45bb8fff65..d6d11fad26 100644
--- a/meta/classes/compress_doc.bbclass
+++ b/meta/classes/compress_doc.bbclass
@@ -160,6 +160,7 @@ def _is_compress_doc(file, compress_format_list):
return False, ''
def compress_doc(topdir, compress_mode, compress_cmds):
+ import subprocess
hardlink_dict = {}
for root, dirs, files in os.walk(topdir):
for f in files:
@@ -187,6 +188,7 @@ def compress_doc(topdir, compress_mode, compress_cmds):
# Decompress doc files which format is not compress_mode
def decompress_doc(topdir, compress_mode, decompress_cmds):
+ import subprocess
hardlink_dict = {}
decompress = True
for root, dirs, files in os.walk(topdir):