Forráskód Böngészése

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.

Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Yeoh Ee Peng 4 éve
szülő
commit
ab661f96e2
1 módosított fájl, 8 hozzáadás és 9 törlés
  1. 8 9
      scripts/oe-pkgdata-util

+ 8 - 9
scripts/oe-pkgdata-util

@@ -389,21 +389,16 @@ def list_pkgs(args):
                     return False
                     return False
         return True
         return True
 
 
+    pkglist = []
     if args.recipe:
     if args.recipe:
         packages = get_recipe_pkgs(args.pkgdata_dir, args.recipe, args.unpackaged)
         packages = get_recipe_pkgs(args.pkgdata_dir, args.recipe, args.unpackaged)
 
 
         if args.runtime:
         if args.runtime:
-            pkglist = []
             runtime_pkgs = lookup_pkglist(packages, args.pkgdata_dir, False)
             runtime_pkgs = lookup_pkglist(packages, args.pkgdata_dir, False)
             for rtpkgs in runtime_pkgs.values():
             for rtpkgs in runtime_pkgs.values():
                 pkglist.extend(rtpkgs)
                 pkglist.extend(rtpkgs)
         else:
         else:
             pkglist = packages
             pkglist = packages
-
-        for pkg in pkglist:
-            if matchpkg(pkg):
-                found = True
-                print("%s" % pkg)
     else:
     else:
         if args.runtime:
         if args.runtime:
             searchdir = 'runtime-reverse'
             searchdir = 'runtime-reverse'
@@ -414,9 +409,13 @@ def list_pkgs(args):
             for fn in files:
             for fn in files:
                 if fn.endswith('.packaged'):
                 if fn.endswith('.packaged'):
                     continue
                     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 not found:
         if args.pkgspec:
         if args.pkgspec:
             logger.error("Unable to find any package matching %s" % args.pkgspec)
             logger.error("Unable to find any package matching %s" % args.pkgspec)