Selaa lähdekoodia

data/cooker: Sort output data shown by -e

Displaying the environment data in a sorted manner makes it easier
to compare data between different setups and means you can know
where to find specific entries.

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Richard Purdie 7 vuotta sitten
vanhempi
commit
baa417e44b
2 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 1 1
      lib/bb/cooker.py
  2. 1 1
      lib/bb/data.py

+ 1 - 1
lib/bb/cooker.py

@@ -648,7 +648,7 @@ class BBCooker:
 
         # emit the metadata which isnt valid shell
         data.expandKeys(envdata)
-        for e in envdata.keys():
+        for e in sorted(envdata.keys()):
             if envdata.getVarFlag(e, 'func', False) and envdata.getVarFlag(e, 'python', False):
                 logger.plain("\npython %s () {\n%s}\n", e, envdata.getVar(e, False))
 

+ 1 - 1
lib/bb/data.py

@@ -196,7 +196,7 @@ def emit_env(o=sys.__stdout__, d = init(), all=False):
     keys = sorted((key for key in d.keys() if not key.startswith("__")), key=isfunc)
     grouped = groupby(keys, isfunc)
     for isfunc, keys in grouped:
-        for key in keys:
+        for key in sorted(keys):
             emit_var(key, o, d, all and not isfunc) and o.write('\n')
 
 def exported_keys(d):