summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Yang <liezhi.yang@windriver.com>2018-08-23 16:07:28 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-08-23 18:02:23 +0100
commit9b0bc119b742627d52289708ddb97c28c4e11677 (patch)
tree6b9b344dca24b6543df156daa3502db43fb6f9ac
parent1ad6e2cd04cbf1e54ea90c018ade602c9cad9595 (diff)
downloadpoky-9b0bc119b742627d52289708ddb97c28c4e11677.tar.gz
compress_doc.bbclass: Clean up getstatusoutput usage
Replace usage of oe.utils.getstatusoutput() with direct subprocess calls. (From OE-Core rev: f1a1b31add242380490023c2ee7eec1b4fbcd85b) Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/compress_doc.bbclass7
1 files changed, 4 insertions, 3 deletions
diff --git a/meta/classes/compress_doc.bbclass b/meta/classes/compress_doc.bbclass
index 069d53492e..45bb8fff65 100644
--- a/meta/classes/compress_doc.bbclass
+++ b/meta/classes/compress_doc.bbclass
@@ -79,6 +79,7 @@ def _collect_hardlink(hardlink_dict, file):
79 return hardlink_dict 79 return hardlink_dict
80 80
81def _process_hardlink(hardlink_dict, compress_mode, shell_cmds, decompress=False): 81def _process_hardlink(hardlink_dict, compress_mode, shell_cmds, decompress=False):
82 import subprocess
82 for target in hardlink_dict: 83 for target in hardlink_dict:
83 if decompress: 84 if decompress:
84 compress_format = _get_compress_format(target, shell_cmds.keys()) 85 compress_format = _get_compress_format(target, shell_cmds.keys())
@@ -87,7 +88,7 @@ def _process_hardlink(hardlink_dict, compress_mode, shell_cmds, decompress=False
87 else: 88 else:
88 cmd = "%s -f %s" % (shell_cmds[compress_mode], target) 89 cmd = "%s -f %s" % (shell_cmds[compress_mode], target)
89 bb.note('compress hardlink %s' % target) 90 bb.note('compress hardlink %s' % target)
90 (retval, output) = oe.utils.getstatusoutput(cmd) 91 (retval, output) = subprocess.getstatusoutput(cmd)
91 if retval: 92 if retval:
92 bb.warn("de/compress file failed %s (cmd was %s)%s" % (retval, cmd, ":\n%s" % output if output else "")) 93 bb.warn("de/compress file failed %s (cmd was %s)%s" % (retval, cmd, ":\n%s" % output if output else ""))
93 return 94 return
@@ -176,7 +177,7 @@ def compress_doc(topdir, compress_mode, compress_cmds):
176 # Normal file 177 # Normal file
177 elif os.path.isfile(file): 178 elif os.path.isfile(file):
178 cmd = "%s %s" % (compress_cmds[compress_mode], file) 179 cmd = "%s %s" % (compress_cmds[compress_mode], file)
179 (retval, output) = oe.utils.getstatusoutput(cmd) 180 (retval, output) = subprocess.getstatusoutput(cmd)
180 if retval: 181 if retval:
181 bb.warn("compress failed %s (cmd was %s)%s" % (retval, cmd, ":\n%s" % output if output else "")) 182 bb.warn("compress failed %s (cmd was %s)%s" % (retval, cmd, ":\n%s" % output if output else ""))
182 continue 183 continue
@@ -206,7 +207,7 @@ def decompress_doc(topdir, compress_mode, decompress_cmds):
206 # Normal file 207 # Normal file
207 elif os.path.isfile(file): 208 elif os.path.isfile(file):
208 cmd = "%s %s" % (decompress_cmds[compress_format], file) 209 cmd = "%s %s" % (decompress_cmds[compress_format], file)
209 (retval, output) = oe.utils.getstatusoutput(cmd) 210 (retval, output) = subprocess.getstatusoutput(cmd)
210 if retval: 211 if retval:
211 bb.warn("decompress failed %s (cmd was %s)%s" % (retval, cmd, ":\n%s" % output if output else "")) 212 bb.warn("decompress failed %s (cmd was %s)%s" % (retval, cmd, ":\n%s" % output if output else ""))
212 continue 213 continue