2022-08-02 15:01:01 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
2018-02-23 09:53:12 +01:00
|
|
|
# Copyright (C) Internet Systems Consortium, Inc. ("ISC")
|
2015-09-30 23:45:36 +00:00
|
|
|
#
|
2021-06-03 08:37:05 +02:00
|
|
|
# SPDX-License-Identifier: MPL-2.0
|
|
|
|
#
|
2016-06-27 14:56:38 +10:00
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
2021-06-03 08:37:05 +02:00
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
2020-09-14 16:20:40 -07:00
|
|
|
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
|
2018-02-23 09:53:12 +01:00
|
|
|
#
|
|
|
|
# See the COPYRIGHT file distributed with this work for additional
|
|
|
|
# information regarding copyright ownership.
|
2015-09-30 23:45:36 +00:00
|
|
|
|
2020-05-08 14:29:14 +10:00
|
|
|
list1=$(
|
2024-08-14 13:25:50 +02:00
|
|
|
grep -h LOGCATEGORY lib/*/include/*/*.h bin/named/include/named/*.h \
|
|
|
|
| grep -E "^[[:space:]]+[^[:space:]]+_LOGCATEGORY_[^[:space:]]+([[:space:]]+=[[:space:]]+[-0-9]+)?," \
|
|
|
|
| grep -Ev "ISC_LOGCATEGORY_(MAX|INVALID)" \
|
2023-10-24 14:43:14 +02:00
|
|
|
| sed -e 's/.*LOGCATEGORY_\([A-Z_]*\).*/\1/' -e 's/^RRL$/rate-limit/' \
|
2022-11-06 14:18:44 +00:00
|
|
|
-e 's/DRA/dns-reporting-agent/' \
|
2024-08-14 13:25:50 +02:00
|
|
|
| tr 'A-Z' 'a-z' \
|
2023-10-24 14:43:14 +02:00
|
|
|
| tr _ - \
|
|
|
|
| sed 's/^tat$/trust-anchor-telemetry/' \
|
|
|
|
| sort -u
|
2020-05-08 14:29:14 +10:00
|
|
|
)
|
|
|
|
list2=$(
|
2023-10-24 14:43:14 +02:00
|
|
|
sed -ne 's/^``\(.*\)``/\1/p' doc/arm/logging-categories.inc.rst \
|
|
|
|
| sort -u
|
2020-05-08 14:29:14 +10:00
|
|
|
)
|
|
|
|
status=0
|
2023-10-24 14:43:14 +02:00
|
|
|
for i in $list1; do
|
|
|
|
ok=no
|
|
|
|
for j in $list2; do
|
|
|
|
if test $i = $j; then
|
|
|
|
ok=yes
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if test $ok = no; then
|
2019-06-19 16:20:24 +10:00
|
|
|
echo "$i missing from doc/arm/logging-categories.rst."
|
2023-10-24 14:43:14 +02:00
|
|
|
status=1
|
|
|
|
fi
|
2015-09-30 12:56:31 +10:00
|
|
|
done
|
2023-10-24 14:43:14 +02:00
|
|
|
for i in $list2; do
|
|
|
|
ok=no
|
|
|
|
for j in $list1; do
|
|
|
|
if test $i = $j; then
|
|
|
|
ok=yes
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if test $ok = no; then
|
2019-06-19 16:20:24 +10:00
|
|
|
echo "documented logging category '$i' not in code."
|
2023-10-24 14:43:14 +02:00
|
|
|
status=1
|
|
|
|
fi
|
2015-09-30 12:56:31 +10:00
|
|
|
done
|
2020-05-08 14:29:14 +10:00
|
|
|
exit $status
|