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