Do not output faulty ".ko" dependency if a scanned .ko file has an empty
"depends=" specification, also replace the `grep | sed | awk` chain with a
single sed program.
Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
SVN-Revision: 44206
for kmod in `find $TARGETS -type f -name \*.ko`; do
$OBJCOPY -O binary -j .modinfo $kmod $tmp
sed -e 's,\x00,\n,g' $tmp | \
- egrep -a '^depends=' | \
- sed -e 's,^depends=,,' -e 's/,/\n/g' | \
- awk '{ print $1 ".ko" }'
+ sed -ne '/^depends=.\+/ { s/^depends=//; s/\(,\|$\)/.ko\n/gp; q }'
done | sort -u
rm -f $tmp