mirror of
git://git.yoctoproject.org/poky.git
synced 2025-07-19 21:09:03 +02:00
lib/oe/recipeutils: return a dict in get_recipe_upgrade_status() instead of a tuple
Putting various things in a tuple is an anti-pattern of sorts, as the consumers have to unpack it into local variables for readability, or access items directly with indexes, which makes code pretty much unreadable. (From OE-Core rev: e86aa26d209eb9809198f6dd40cd058366318e3d) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
parent
def276f0c4
commit
597b87a468
|
@ -1112,7 +1112,7 @@ def _get_recipe_upgrade_status(data):
|
|||
maintainer = data.getVar('RECIPE_MAINTAINER')
|
||||
no_upgrade_reason = data.getVar('RECIPE_NO_UPDATE_REASON')
|
||||
|
||||
return (pn, status, cur_ver, next_ver, maintainer, revision, no_upgrade_reason)
|
||||
return {'pn':pn, 'status':status, 'cur_ver':cur_ver, 'next_ver':next_ver, 'maintainer':maintainer, 'revision':revision, 'no_upgrade_reason':no_upgrade_reason}
|
||||
|
||||
def get_recipe_upgrade_status(recipes=None):
|
||||
pkgs_list = []
|
||||
|
|
|
@ -22,8 +22,8 @@ class Distrodata(OESelftestTestCase):
|
|||
|
||||
pkgs = oe.recipeutils.get_recipe_upgrade_status()
|
||||
|
||||
regressed_failures = [pkg[0] for pkg in pkgs if pkg[1] == 'UNKNOWN_BROKEN']
|
||||
regressed_successes = [pkg[0] for pkg in pkgs if pkg[1] == 'KNOWN_BROKEN']
|
||||
regressed_failures = [pkg['pn'] for pkg in pkgs if pkg['status'] == 'UNKNOWN_BROKEN']
|
||||
regressed_successes = [pkg['pn'] for pkg in pkgs if pkg['status'] == 'KNOWN_BROKEN']
|
||||
msg = ""
|
||||
if len(regressed_failures) > 0:
|
||||
msg = msg + """
|
||||
|
|
|
@ -659,13 +659,13 @@ def check_upgrade_status(args, config, basepath, workspace):
|
|||
results = oe.recipeutils.get_recipe_upgrade_status(args.recipe)
|
||||
for result in results:
|
||||
# pn, update_status, current, latest, maintainer, latest_commit, no_update_reason
|
||||
if args.all or result[1] != 'MATCH':
|
||||
print("{:25} {:15} {:15} {} {} {}".format( result[0],
|
||||
result[2],
|
||||
result[1] if result[1] != 'UPDATE' else (result[3] if not result[3].endswith("new-commits-available") else "new commits"),
|
||||
result[4],
|
||||
result[5] if result[5] != 'N/A' else "",
|
||||
"cannot be updated due to: %s" %(result[6]) if result[6] else ""))
|
||||
if args.all or result['status'] != 'MATCH':
|
||||
print("{:25} {:15} {:15} {} {} {}".format( result['pn'],
|
||||
result['cur_ver'],
|
||||
result['status'] if result['status'] != 'UPDATE' else (result['next_ver'] if not result['next_ver'].endswith("new-commits-available") else "new commits"),
|
||||
result['maintainer'],
|
||||
result['revision'] if result['revision'] != 'N/A' else "",
|
||||
"cannot be updated due to: %s" %(result['no_upgrade_reason']) if result['no_upgrade_reason'] else ""))
|
||||
|
||||
def register_commands(subparsers, context):
|
||||
"""Register devtool subcommands from this plugin"""
|
||||
|
|
Loading…
Reference in New Issue
Block a user