blob: 43de226071ae38adbc919f951cda442855bc967c [file] [log] [blame]
Masahiro Yamada3a48a912019-05-18 01:07:15 +09001#!/bin/sh
2# SPDX-License-Identifier: GPL-2.0
3
4set -e
5
Masahiro Yamada84517912020-05-11 13:21:49 +09006if [ $# != 1 ]; then
7 echo "Usage: $0 <modules.order>" >& 2
8 exit 1
9fi
10
11exit_code=0
12
Masahiro Yamada3a48a912019-05-18 01:07:15 +090013# Check uniqueness of module names
14check_same_name_modules()
15{
Masahiro Yamada84517912020-05-11 13:21:49 +090016 for m in $(sed 's:.*/::' $1 | sort | uniq -d)
Masahiro Yamada3a48a912019-05-18 01:07:15 +090017 do
Masahiro Yamada84517912020-05-11 13:21:49 +090018 echo "error: the following would cause module name conflict:" >&2
Masahiro Yamada1bd9a462019-07-17 15:17:50 +090019 sed -n "/\/$m/s:^: :p" modules.order >&2
Masahiro Yamada84517912020-05-11 13:21:49 +090020 exit_code=1
Masahiro Yamada3a48a912019-05-18 01:07:15 +090021 done
22}
23
Masahiro Yamada84517912020-05-11 13:21:49 +090024check_same_name_modules "$1"
25
26exit $exit_code