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