]> code.ossystems Code Review - openembedded-core.git/commitdiff
scripts/oe-pkgdata-util: Enable list-pkgs to print ordered packages
authorYeoh Ee Peng <ee.peng.yeoh@intel.com>
Fri, 1 Nov 2019 06:43:47 +0000 (14:43 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 4 Nov 2019 13:31:27 +0000 (13:31 +0000)
The list-pkgs currently print packages in unordered format.
Enable list-pkgs to print ordered packages that will ease
viewing.

Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
scripts/oe-pkgdata-util

index 9cc78d110498dc2133639165a0b899f0d1d418f1..93220e36178e27f70c6b4b4938faa113977aff13 100755 (executable)
@@ -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)