summaryrefslogtreecommitdiff
path: root/modutils/depmod_process.sh
blob: f99b09153fc8d4ce6b218754eb042369058b7a57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

# Depmod output may be hard to diff.
# This script sorts dependencies within "xx.ko: yy.ko zz.ko" lines,
# and sorts all lines too.
# Usage:
#
# [./busybox] depmod -n | ./depmod_process.sh | sort >OUTFILE
#
# and then you can diff OUTFILEs. Useful for comparing bbox depmod
# with module-init-tools depmod and such.

while read -r word rest; do
    if ! test "${word/*:/}"; then
	echo -n "$word "
	echo "$rest" | xargs -n1 | sort | xargs
    else
	echo "$word $rest";
    fi
done