Commit | Line | Data |
---|---|---|
3a48a919 MY |
1 | #!/bin/sh |
2 | # SPDX-License-Identifier: GPL-2.0 | |
3 | ||
4 | set -e | |
5 | ||
8451791d MY |
6 | if [ $# != 1 ]; then |
7 | echo "Usage: $0 <modules.order>" >& 2 | |
8 | exit 1 | |
9 | fi | |
10 | ||
11 | exit_code=0 | |
12 | ||
3a48a919 MY |
13 | # Check uniqueness of module names |
14 | check_same_name_modules() | |
15 | { | |
8451791d | 16 | for m in $(sed 's:.*/::' $1 | sort | uniq -d) |
3a48a919 | 17 | do |
8451791d | 18 | echo "error: the following would cause module name conflict:" >&2 |
1bd9a468 | 19 | sed -n "/\/$m/s:^: :p" modules.order >&2 |
8451791d | 20 | exit_code=1 |
3a48a919 MY |
21 | done |
22 | } | |
23 | ||
8451791d MY |
24 | check_same_name_modules "$1" |
25 | ||
26 | exit $exit_code |