Skip to content

Commit

Permalink
grub-core/genmoddep.awk: Ensure output is deterministic
Browse files Browse the repository at this point in the history
The output in moddep.lst generated from syminfo.lst using genmoddep.awk
is not deterministic since the order of the dependencies on each line
can vary depending on how awk sorts the values in the array.

Be deterministic in the output by sorting the dependencies on each line.

Signed-off-by: Alexander Kanavin <[email protected]>
Reviewed-by: Daniel Kiper <[email protected]>
  • Loading branch information
kanavin authored and Daniel Kiper committed Jun 13, 2023
1 parent ab2aeda commit 87648e9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion grub-core/genmoddep.awk
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@ END {
}
modlist = ""
depcount[mod] = 0
for (depmod in uniqmods) {
n = asorti(uniqmods, w)
for (i = 1; i <= n; i++) {
depmod = w[i]
modlist = modlist " " depmod;
inverse_dependencies[depmod] = inverse_dependencies[depmod] " " mod
depcount[mod]++
Expand Down

0 comments on commit 87648e9

Please sign in to comment.