data: Ensure functions are defined in a deterministic order
PATCH 1/1 data: Ensure functions are defined in a deterministic order
When writing functions into shell scripts, write then in a deterministic order. This is unlikely to affect anything at runtime but it does change the signatures of the generated useradd postinst scripts in OE-Core and is a good thing to be consistent about in general.
Signed-off-by Richard Purdie <[email protected]>
--- lib/bb/data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/bb/data.py +1 -1
@@ -226,7 +226,7 @@ def emit_func(func, o=sys.__stdout__, d = init()): deps = newdeps seen |= deps newdeps = set() - for dep in deps: + for dep in sorted(deps): if d.getVarFlag(dep, "func", False) and not d.getVarFlag(dep, "python", False): emit_var(dep, o, d, False) and o.write('\n') newdeps |= bb.codeparser.ShellParser(dep, logger).parse_shell(d.getVar(dep))
Signature · 1 line
2.32.0