summaryrefslogtreecommitdiffstats
path: root/meta/lib/oe
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2018-07-20 15:15:38 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-07-24 11:52:27 +0100
commitadea90740d45628685d0828b3103109432c25857 (patch)
treede9b7412ee9be68611111fe9bc49e204e683872d /meta/lib/oe
parent1d8924f1727d3d3c954d4c9002fe8827552bf5bf (diff)
downloadpoky-adea90740d45628685d0828b3103109432c25857.tar.gz
package/package_manager: multiprocess_exec -> multiprocess_launch
After this replacement, the parent exception handling works so we don't need subprocess wrapping with bb.error in the underlying functions. The underlying contexts also have better module handling so the imports can be cleaned up. (From OE-Core rev: aa8260adf53139d776a2affe6118d28b295c1fab) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oe')
-rw-r--r--meta/lib/oe/package.py13
-rw-r--r--meta/lib/oe/package_manager.py5
2 files changed, 5 insertions, 13 deletions
diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py
index 4255143371..fa3428ad61 100644
--- a/meta/lib/oe/package.py
+++ b/meta/lib/oe/package.py
@@ -1,3 +1,4 @@
1import stat
1import mmap 2import mmap
2import subprocess 3import subprocess
3 4
@@ -11,8 +12,6 @@ def runstrip(arg):
11 # 8 - shared library 12 # 8 - shared library
12 # 16 - kernel module 13 # 16 - kernel module
13 14
14 import stat, subprocess
15
16 (file, elftype, strip) = arg 15 (file, elftype, strip) = arg
17 16
18 newmode = None 17 newmode = None
@@ -37,16 +36,11 @@ def runstrip(arg):
37 stripcmd.append(file) 36 stripcmd.append(file)
38 bb.debug(1, "runstrip: %s" % stripcmd) 37 bb.debug(1, "runstrip: %s" % stripcmd)
39 38
40 try: 39 output = subprocess.check_output(stripcmd, stderr=subprocess.STDOUT)
41 output = subprocess.check_output(stripcmd, stderr=subprocess.STDOUT)
42 except subprocess.CalledProcessError as e:
43 bb.error("runstrip: '%s' strip command failed with %s (%s)" % (stripcmd, e.returncode, e.output))
44 40
45 if newmode: 41 if newmode:
46 os.chmod(file, origmode) 42 os.chmod(file, origmode)
47 43
48 return
49
50# Detect .ko module by searching for "vermagic=" string 44# Detect .ko module by searching for "vermagic=" string
51def is_kernel_module(path): 45def is_kernel_module(path):
52 with open(path) as f: 46 with open(path) as f:
@@ -164,8 +158,7 @@ def strip_execs(pn, dstdir, strip_cmd, libdir, base_libdir, d, qa_already_stripp
164 elf_file = int(elffiles[file]) 158 elf_file = int(elffiles[file])
165 sfiles.append((file, elf_file, strip_cmd)) 159 sfiles.append((file, elf_file, strip_cmd))
166 160
167 oe.utils.multiprocess_exec(sfiles, runstrip) 161 oe.utils.multiprocess_launch(runstrip, sfiles, d)
168
169 162
170 163
171def file_translate(file): 164def file_translate(file):
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 9aa5847c8a..64c8a91216 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -3,7 +3,6 @@ import os
3import glob 3import glob
4import subprocess 4import subprocess
5import shutil 5import shutil
6import multiprocessing
7import re 6import re
8import collections 7import collections
9import bb 8import bb
@@ -177,7 +176,7 @@ class OpkgIndexer(Indexer):
177 bb.note("There are no packages in %s!" % self.deploy_dir) 176 bb.note("There are no packages in %s!" % self.deploy_dir)
178 return 177 return
179 178
180 oe.utils.multiprocess_exec(index_cmds, create_index) 179 oe.utils.multiprocess_launch(create_index, index_cmds, self.d)
181 180
182 if signer: 181 if signer:
183 feed_sig_type = self.d.getVar('PACKAGE_FEED_GPG_SIGNATURE_TYPE') 182 feed_sig_type = self.d.getVar('PACKAGE_FEED_GPG_SIGNATURE_TYPE')
@@ -258,7 +257,7 @@ class DpkgIndexer(Indexer):
258 bb.note("There are no packages in %s" % self.deploy_dir) 257 bb.note("There are no packages in %s" % self.deploy_dir)
259 return 258 return
260 259
261 oe.utils.multiprocess_exec(index_cmds, create_index) 260 oe.utils.multiprocess_launch(create_index, index_cmds, self.d)
262 if self.d.getVar('PACKAGE_FEED_SIGN') == '1': 261 if self.d.getVar('PACKAGE_FEED_SIGN') == '1':
263 raise NotImplementedError('Package feed signing not implementd for dpkg') 262 raise NotImplementedError('Package feed signing not implementd for dpkg')
264 263