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