summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2017-09-01 16:50:56 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-09-02 00:52:10 +0100
commit91f9752cf1cd6a7caa34bccc4f929d243f1a51ac (patch)
tree41af4374a396381bc8f40b3caedc8a6db1fe92ad
parenta6631eed6fc70b305e769998d6f22f345e37decc (diff)
downloadpoky-91f9752cf1cd6a7caa34bccc4f929d243f1a51ac.tar.gz
package_manager: Clean up horrible 'None' return values
If this fails the exception will now be raised. Lets use that and drop all this 'None' return value ugliness. (From OE-Core rev: b3c63b3b816179b96f1ed9b5baaf6e1f1c3c7b80) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oe/package_manager.py19
1 files changed, 4 insertions, 15 deletions
diff --git a/meta/lib/oe/package_manager.py b/meta/lib/oe/package_manager.py
index 5efb286f7b..994e462445 100644
--- a/meta/lib/oe/package_manager.py
+++ b/meta/lib/oe/package_manager.py
@@ -17,18 +17,11 @@ from oe.gpg_sign import get_signer
17def create_index(arg): 17def create_index(arg):
18 index_cmd = arg 18 index_cmd = arg
19 19
20 try: 20 bb.note("Executing '%s' ..." % index_cmd)
21 bb.note("Executing '%s' ..." % index_cmd) 21 result = subprocess.check_output(index_cmd, stderr=subprocess.STDOUT, shell=True).decode("utf-8")
22 result = subprocess.check_output(index_cmd, stderr=subprocess.STDOUT, shell=True).decode("utf-8")
23 except subprocess.CalledProcessError as e:
24 return("Index creation command '%s' failed with return code %d:\n%s" %
25 (e.cmd, e.returncode, e.output.decode("utf-8")))
26
27 if result: 22 if result:
28 bb.note(result) 23 bb.note(result)
29 24
30 return None
31
32""" 25"""
33This method parse the output from the package managerand return 26This method parse the output from the package managerand return
34a dictionary with the information of the packages. This is used 27a dictionary with the information of the packages. This is used
@@ -164,9 +157,7 @@ class OpkgIndexer(Indexer):
164 bb.note("There are no packages in %s!" % self.deploy_dir) 157 bb.note("There are no packages in %s!" % self.deploy_dir)
165 return 158 return
166 159
167 result = oe.utils.multiprocess_exec(index_cmds, create_index) 160 oe.utils.multiprocess_exec(index_cmds, create_index)
168 if result:
169 bb.fatal('%s' % ('\n'.join(result)))
170 161
171 if signer: 162 if signer:
172 feed_sig_type = self.d.getVar('PACKAGE_FEED_GPG_SIGNATURE_TYPE') 163 feed_sig_type = self.d.getVar('PACKAGE_FEED_GPG_SIGNATURE_TYPE')
@@ -247,9 +238,7 @@ class DpkgIndexer(Indexer):
247 bb.note("There are no packages in %s" % self.deploy_dir) 238 bb.note("There are no packages in %s" % self.deploy_dir)
248 return 239 return
249 240
250 result = oe.utils.multiprocess_exec(index_cmds, create_index) 241 oe.utils.multiprocess_exec(index_cmds, create_index)
251 if result:
252 bb.fatal('%s' % ('\n'.join(result)))
253 if self.d.getVar('PACKAGE_FEED_SIGN') == '1': 242 if self.d.getVar('PACKAGE_FEED_SIGN') == '1':
254 raise NotImplementedError('Package feed signing not implementd for dpkg') 243 raise NotImplementedError('Package feed signing not implementd for dpkg')
255 244