summaryrefslogtreecommitdiffstats
path: root/meta/classes/compress_doc.bbclass
diff options
context:
space:
mode:
authorAndré Draszik <andre.draszik@jci.com>2019-01-16 10:12:38 (GMT)
committerRichard Purdie <richard.purdie@linuxfoundation.org>2019-01-16 15:35:07 (GMT)
commit46bd0598692b6e45f0da0b0e5e1bbe653460334c (patch)
treeeb4a42aae3e9b6e3e378beda7adcfb92e1b74d70 /meta/classes/compress_doc.bbclass
parent77f291c7dc446f3acf4499badeb45469c4f6c828 (diff)
downloadpoky-46bd0598692b6e45f0da0b0e5e1bbe653460334c.tar.gz
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. (From OE-Core rev: 539f65d2533a277233d83d085cb78bdf56a6e16c) Signed-off-by: André Draszik <andre.draszik@jci.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/compress_doc.bbclass')
-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 45bb8ff..d6d11fa 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):
160 return False, '' 160 return False, ''
161 161
162def compress_doc(topdir, compress_mode, compress_cmds): 162def compress_doc(topdir, compress_mode, compress_cmds):
163 import subprocess
163 hardlink_dict = {} 164 hardlink_dict = {}
164 for root, dirs, files in os.walk(topdir): 165 for root, dirs, files in os.walk(topdir):
165 for f in files: 166 for f in files:
@@ -187,6 +188,7 @@ def compress_doc(topdir, compress_mode, compress_cmds):
187 188
188# Decompress doc files which format is not compress_mode 189# Decompress doc files which format is not compress_mode
189def decompress_doc(topdir, compress_mode, decompress_cmds): 190def decompress_doc(topdir, compress_mode, decompress_cmds):
191 import subprocess
190 hardlink_dict = {} 192 hardlink_dict = {}
191 decompress = True 193 decompress = True
192 for root, dirs, files in os.walk(topdir): 194 for root, dirs, files in os.walk(topdir):