diff mbox series

[v2,1/1] cooker: Sort pn-buildlist

Message ID a8c3f9aea215c7e47eaa57a8834854c2daafb027.1730462200.git.liezhi.yang@windriver.com
State Accepted, archived
Commit 529043117a7c62feb45bc891658a412cc8dd7e3f
Headers show
Series [v2,1/1] cooker: Sort pn-buildlist | expand

Commit Message

Robert Yang Nov. 1, 2024, 11:58 a.m. UTC
From: Robert Yang <liezhi.yang@windriver.com>

So that we can compare the different pn-buildlist easily.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 lib/bb/cooker.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index 2e809866408..d58c0f575ce 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -900,10 +900,11 @@  class BBCooker:
 
         depgraph = self.generateTaskDepTreeData(pkgs_to_build, task)
 
-        with open('pn-buildlist', 'w') as f:
-            for pn in depgraph["pn"]:
-                f.write(pn + "\n")
-        logger.info("PN build list saved to 'pn-buildlist'")
+        pns = depgraph["pn"].keys()
+        if pns:
+            with open('pn-buildlist', 'w') as f:
+                f.write("%s\n" % "\n".join(sorted(pns)))
+            logger.info("PN build list saved to 'pn-buildlist'")
 
         # Remove old format output files to ensure no confusion with stale data
         try: