From 6910dbe3413e684bff9a194945df60345ecbc623 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sat, 12 Mar 2022 22:47:49 -0700 Subject: env: Allow text-env tests to run with awk At present the tests assume that gawk is being used. Adjust the tests so that the names are inserted in alphabetical order, so that awk is happy. Also use PROCINFO to make gawk output in alphabetical order. This is not ideal, since it changes the env-car ordering from what the user provided, but it may be acceptable. Signed-off-by: Simon Glass Reported-by: Patrick Delaunay Fixes: https://source.denx.de/u-boot/u-boot/-/issues/10 --- scripts/env2string.awk | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'scripts/env2string.awk') diff --git a/scripts/env2string.awk b/scripts/env2string.awk index 1bfe9ed07a4..de470a49941 100644 --- a/scripts/env2string.awk +++ b/scripts/env2string.awk @@ -81,7 +81,10 @@ END { if (do_output) { printf("%s", "#define CONFIG_EXTRA_ENV_TEXT \"") - # Print out all the variables + # Print out all the variables by alphabetic order, if using + # gawk. This allows test_env_test.py to work on both awk (where + # this next line does nothing) + PROCINFO["sorted_in"] = "@ind_str_asc" for (var in vars) { env = vars[var] print var "=" vars[var] "\\0" -- cgit v1.2.3