From 7035b4b21e02786932a512ae2f954bed441f8adf Mon Sep 17 00:00:00 2001 From: Yeoh Ee Peng Date: Fri, 1 Nov 2019 14:43:47 +0800 Subject: scripts/oe-pkgdata-util: Enable list-pkgs to print ordered packages The list-pkgs currently print packages in unordered format. Enable list-pkgs to print ordered packages that will ease viewing. (From OE-Core rev: ab661f96e2fd529588692c978274a840f34ee7cf) Signed-off-by: Yeoh Ee Peng Signed-off-by: Ross Burton Signed-off-by: Richard Purdie --- scripts/oe-pkgdata-util | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'scripts') diff --git a/scripts/oe-pkgdata-util b/scripts/oe-pkgdata-util index 9cc78d1104..93220e3617 100755 --- a/scripts/oe-pkgdata-util +++ b/scripts/oe-pkgdata-util @@ -389,21 +389,16 @@ def list_pkgs(args): return False return True + pkglist = [] if args.recipe: packages = get_recipe_pkgs(args.pkgdata_dir, args.recipe, args.unpackaged) if args.runtime: - pkglist = [] runtime_pkgs = lookup_pkglist(packages, args.pkgdata_dir, False) for rtpkgs in runtime_pkgs.values(): pkglist.extend(rtpkgs) else: pkglist = packages - - for pkg in pkglist: - if matchpkg(pkg): - found = True - print("%s" % pkg) else: if args.runtime: searchdir = 'runtime-reverse' @@ -414,9 +409,13 @@ def list_pkgs(args): for fn in files: if fn.endswith('.packaged'): continue - if matchpkg(fn): - found = True - print("%s" % fn) + pkglist.append(fn) + + for pkg in sorted(pkglist): + if matchpkg(pkg): + found = True + print("%s" % pkg) + if not found: if args.pkgspec: logger.error("Unable to find any package matching %s" % args.pkgspec) -- cgit v1.2.3-54-g00ecf