asorti is only implemented by GAWK; replace by the sort system command,
so that we can build with other implementations.

Fixes: 87648e9c12a3 ("grub-core/genmoddep.awk: Ensure output is deterministic", 
2023-06-01)
Signed-off-by: Ismael Luceno <iluc...@suse.de>
---
 grub-core/genmoddep.awk | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/grub-core/genmoddep.awk b/grub-core/genmoddep.awk
index ab457cb2b564..66ecb4b1d05b 100644
--- a/grub-core/genmoddep.awk
+++ b/grub-core/genmoddep.awk
@@ -50,22 +50,19 @@ END {
   total_depcount = 0
 
   for (mod in modtab) {
+    sort_cmd = "sort -u > " mod ".deps"
     # Remove duplications.
     split(modtab[mod], depmods, " ");
-    for (depmod in uniqmods) {
-      delete uniqmods[depmod];
-    }
     for (i in depmods) {
       depmod = depmods[i];
       # Ignore kernel, as always loaded.
       if (depmod != "kernel" && depmod != mod)
-       uniqmods[depmod] = 1;
+       print depmod | sort_cmd
     }
+    close(sort_cmd)
     modlist = ""
     depcount[mod] = 0
-    n = asorti(uniqmods, w)
-    for (i = 1; i <= n; i++) {
-      depmod = w[i]
+    while (getline depmod < (mod ".deps") == 1) {
       modlist = modlist " " depmod;
       inverse_dependencies[depmod] = inverse_dependencies[depmod] " " mod
       depcount[mod]++
-- 
2.49.0


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to