summaryrefslogtreecommitdiffstats
path: root/scripts/lib/devtool/upgrade.py
diff options
context:
space:
mode:
authorAlexander Kanavin <alex@linutronix.de>2024-07-17 20:22:13 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-07-22 16:53:06 +0100
commit597b87a46855a792d0d78209db1a85b96a50ac8e (patch)
treeb9874015bba89bc33007bcc3deae5251884a3673 /scripts/lib/devtool/upgrade.py
parentdef276f0c4c43fa4b95b7b38a944de7cc7e9286f (diff)
downloadpoky-597b87a46855a792d0d78209db1a85b96a50ac8e.tar.gz
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>
Diffstat (limited to 'scripts/lib/devtool/upgrade.py')
-rw-r--r--scripts/lib/devtool/upgrade.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/scripts/lib/devtool/upgrade.py b/scripts/lib/devtool/upgrade.py
index 8e13833b51..10b4f8b5ee 100644
--- a/scripts/lib/devtool/upgrade.py
+++ b/scripts/lib/devtool/upgrade.py
@@ -659,13 +659,13 @@ def check_upgrade_status(args, config, basepath, workspace):
659 results = oe.recipeutils.get_recipe_upgrade_status(args.recipe) 659 results = oe.recipeutils.get_recipe_upgrade_status(args.recipe)
660 for result in results: 660 for result in results:
661 # pn, update_status, current, latest, maintainer, latest_commit, no_update_reason 661 # pn, update_status, current, latest, maintainer, latest_commit, no_update_reason
662 if args.all or result[1] != 'MATCH': 662 if args.all or result['status'] != 'MATCH':
663 print("{:25} {:15} {:15} {} {} {}".format( result[0], 663 print("{:25} {:15} {:15} {} {} {}".format( result['pn'],
664 result[2], 664 result['cur_ver'],
665 result[1] if result[1] != 'UPDATE' else (result[3] if not result[3].endswith("new-commits-available") else "new commits"), 665 result['status'] if result['status'] != 'UPDATE' else (result['next_ver'] if not result['next_ver'].endswith("new-commits-available") else "new commits"),
666 result[4], 666 result['maintainer'],
667 result[5] if result[5] != 'N/A' else "", 667 result['revision'] if result['revision'] != 'N/A' else "",
668 "cannot be updated due to: %s" %(result[6]) if result[6] else "")) 668 "cannot be updated due to: %s" %(result['no_upgrade_reason']) if result['no_upgrade_reason'] else ""))
669 669
670def register_commands(subparsers, context): 670def register_commands(subparsers, context):
671 """Register devtool subcommands from this plugin""" 671 """Register devtool subcommands from this plugin"""