summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorHongxu Jia <hongxu.jia@windriver.com>2014-11-21 16:00:55 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-12-03 12:23:59 +0000
commit5007319cd2b19c846a19c948109e2cb977f53115 (patch)
treeda0f4803ffe0bd61f34847991fd751343af70d4b /meta/lib
parent5030c7fb3ef919ebd98ff9c8b22e070a86e66617 (diff)
downloadpoky-5007319cd2b19c846a19c948109e2cb977f53115.tar.gz
package_manager.py: check the result of create_index
While invoking create_index failed, there was no error output and didn't break the build until the package installation. ... |ERROR: run-postinsts not found in the base feeds (qemux86 i586 x86 noarch any all). ... The reason is we used multiprocessing to execute create_index, and did not check its invoking result. (From OE-Core rev: d8921e4ea68647dfcf02ae046c9e09bf59f3e6e4) Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oe/package_manager.py20
1 files changed, 16 insertions, 4 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index e18e071106..3c1e74f43d 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -16,11 +16,14 @@ def create_index(arg):
16 16
17 try: 17 try:
18 bb.note("Executing '%s' ..." % index_cmd) 18 bb.note("Executing '%s' ..." % index_cmd)
19 subprocess.check_output(index_cmd, stderr=subprocess.STDOUT, shell=True) 19 result = subprocess.check_output(index_cmd, stderr=subprocess.STDOUT, shell=True)
20 except subprocess.CalledProcessError as e: 20 except subprocess.CalledProcessError as e:
21 return("Index creation command '%s' failed with return code %d:\n%s" % 21 return("Index creation command '%s' failed with return code %d:\n%s" %
22 (e.cmd, e.returncode, e.output)) 22 (e.cmd, e.returncode, e.output))
23 23
24 if result:
25 bb.note(result)
26
24 return None 27 return None
25 28
26 29
@@ -120,7 +123,10 @@ class RpmIndexer(Indexer):
120 bb.note("There are no packages in %s" % self.deploy_dir) 123 bb.note("There are no packages in %s" % self.deploy_dir)
121 return 124 return
122 125
123 oe.utils.multiprocess_exec(index_cmds, create_index) 126 result = oe.utils.multiprocess_exec(index_cmds, create_index)
127 if result:
128 bb.fatal('%s' % ('\n'.join(result)))
129
124 130
125class OpkgIndexer(Indexer): 131class OpkgIndexer(Indexer):
126 def write_index(self): 132 def write_index(self):
@@ -156,7 +162,10 @@ class OpkgIndexer(Indexer):
156 bb.note("There are no packages in %s!" % self.deploy_dir) 162 bb.note("There are no packages in %s!" % self.deploy_dir)
157 return 163 return
158 164
159 oe.utils.multiprocess_exec(index_cmds, create_index) 165 result = oe.utils.multiprocess_exec(index_cmds, create_index)
166 if result:
167 bb.fatal('%s' % ('\n'.join(result)))
168
160 169
161 170
162class DpkgIndexer(Indexer): 171class DpkgIndexer(Indexer):
@@ -200,7 +209,10 @@ class DpkgIndexer(Indexer):
200 bb.note("There are no packages in %s" % self.deploy_dir) 209 bb.note("There are no packages in %s" % self.deploy_dir)
201 return 210 return
202 211
203 oe.utils.multiprocess_exec(index_cmds, create_index) 212 result = oe.utils.multiprocess_exec(index_cmds, create_index)
213 if result:
214 bb.fatal('%s' % ('\n'.join(result)))
215
204 216
205 217
206class PkgsList(object): 218class PkgsList(object):