Config conflict checking vs. USE_SQLITE
[exim.git] / src / scripts / source_checks
1 #!/bin/sh
2 # Copyright (c) The Exim Maintainters 2022
3 # SPDX-License-Identifier: GPL-2.0-or-later
4
5 cd src;
6
7 # Tables with struct items
8 while read file table
9 do
10   : $file $table
11   < $file \
12   perl -e '$/= undef; while (<>) { print $1 if /(?<='$table'\[\])\s*=\s*{\n(([^}].*\n)+)/m }' \
13   | awk '/{ (US)?"/ {print $2}' \
14   | awk -F\" '{print $2}' \
15   | LC_ALL=C sort -c \
16   || exit 1
17 done <<-END
18         readconf.c      optionlist_config
19         globals.c       optionlist_auths
20         globals.c       debug_options
21         globals.c       header_names
22         globals.c       log_options
23         expand.c        item_table
24         std-crypto.c    dh_constants
25         transport.c     optionlist_transports
26         route.c         optionlist_routers
27         transports/appendfile.c appendfile_transport_options
28         transports/autoreply.c  autoreply_transport_options
29         transports/lmtp.c       lmtp_transport_options
30         transports/pipe.c       pipe_transport_options
31         transports/smtp.c       smtp_transport_options
32         expand.c        var_table
33         acl.c           conditions
34         acl.c           controls_list
35 END
36
37 # Tables with just string items
38 while read file table
39 do
40   : $file $table
41   < $file \
42   perl -e '$/= undef; while (<>) { print $1 if /(?<='$table'\[\])\s*=\s*{\s?(([^}]*)+)}/m }' \
43   | awk -F\" '/"/ {print $2}' \
44   | LC_ALL=C sort -c \
45   || exit 1
46
47 done <<-END
48         expand.c        item_table
49         expand.c        op_table_underscore
50         expand.c        op_table_main
51         expand.c        cond_table
52         acl.c           verbs
53 END
54