2019-05-18 00:07:15 +08:00
|
|
|
#!/bin/sh
|
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
2020-05-11 12:21:49 +08:00
|
|
|
if [ $# != 1 ]; then
|
|
|
|
echo "Usage: $0 <modules.order>" >& 2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
exit_code=0
|
|
|
|
|
2019-05-18 00:07:15 +08:00
|
|
|
# Check uniqueness of module names
|
|
|
|
check_same_name_modules()
|
|
|
|
{
|
2020-05-11 12:21:49 +08:00
|
|
|
for m in $(sed 's:.*/::' $1 | sort | uniq -d)
|
2019-05-18 00:07:15 +08:00
|
|
|
do
|
2020-05-11 12:21:49 +08:00
|
|
|
echo "error: the following would cause module name conflict:" >&2
|
2019-07-17 14:17:50 +08:00
|
|
|
sed -n "/\/$m/s:^: :p" modules.order >&2
|
2020-05-11 12:21:49 +08:00
|
|
|
exit_code=1
|
2019-05-18 00:07:15 +08:00
|
|
|
done
|
|
|
|
}
|
|
|
|
|
2020-05-11 12:21:49 +08:00
|
|
|
check_same_name_modules "$1"
|
|
|
|
|
|
|
|
exit $exit_code
|