mirror of
https://git.yoctoproject.org/poky
synced 2026-06-01 13:09:50 +00:00
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>
This commit is contained in:
@@ -17,18 +17,11 @@ from oe.gpg_sign import get_signer
|
|||||||
def create_index(arg):
|
def create_index(arg):
|
||||||
index_cmd = arg
|
index_cmd = arg
|
||||||
|
|
||||||
try:
|
bb.note("Executing '%s' ..." % index_cmd)
|
||||||
bb.note("Executing '%s' ..." % index_cmd)
|
result = subprocess.check_output(index_cmd, stderr=subprocess.STDOUT, shell=True).decode("utf-8")
|
||||||
result = subprocess.check_output(index_cmd, stderr=subprocess.STDOUT, shell=True).decode("utf-8")
|
|
||||||
except subprocess.CalledProcessError as e:
|
|
||||||
return("Index creation command '%s' failed with return code %d:\n%s" %
|
|
||||||
(e.cmd, e.returncode, e.output.decode("utf-8")))
|
|
||||||
|
|
||||||
if result:
|
if result:
|
||||||
bb.note(result)
|
bb.note(result)
|
||||||
|
|
||||||
return None
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
This method parse the output from the package managerand return
|
This method parse the output from the package managerand return
|
||||||
a dictionary with the information of the packages. This is used
|
a dictionary with the information of the packages. This is used
|
||||||
@@ -164,9 +157,7 @@ class OpkgIndexer(Indexer):
|
|||||||
bb.note("There are no packages in %s!" % self.deploy_dir)
|
bb.note("There are no packages in %s!" % self.deploy_dir)
|
||||||
return
|
return
|
||||||
|
|
||||||
result = oe.utils.multiprocess_exec(index_cmds, create_index)
|
oe.utils.multiprocess_exec(index_cmds, create_index)
|
||||||
if result:
|
|
||||||
bb.fatal('%s' % ('\n'.join(result)))
|
|
||||||
|
|
||||||
if signer:
|
if signer:
|
||||||
feed_sig_type = self.d.getVar('PACKAGE_FEED_GPG_SIGNATURE_TYPE')
|
feed_sig_type = self.d.getVar('PACKAGE_FEED_GPG_SIGNATURE_TYPE')
|
||||||
@@ -247,9 +238,7 @@ class DpkgIndexer(Indexer):
|
|||||||
bb.note("There are no packages in %s" % self.deploy_dir)
|
bb.note("There are no packages in %s" % self.deploy_dir)
|
||||||
return
|
return
|
||||||
|
|
||||||
result = oe.utils.multiprocess_exec(index_cmds, create_index)
|
oe.utils.multiprocess_exec(index_cmds, create_index)
|
||||||
if result:
|
|
||||||
bb.fatal('%s' % ('\n'.join(result)))
|
|
||||||
if self.d.getVar('PACKAGE_FEED_SIGN') == '1':
|
if self.d.getVar('PACKAGE_FEED_SIGN') == '1':
|
||||||
raise NotImplementedError('Package feed signing not implementd for dpkg')
|
raise NotImplementedError('Package feed signing not implementd for dpkg')
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user