diff options
author | Frantisek Sumsal <frantisek@sumsal.cz> | 2021-04-20 13:02:02 +0200 |
---|---|---|
committer | Frantisek Sumsal <frantisek@sumsal.cz> | 2021-04-20 20:11:13 +0200 |
commit | 3b6fd3c1dea070cb1882b8810e18a45158a356f2 (patch) | |
tree | 1a42abd78e9acf4cf528c6e0e8998652c87ede9d /tools/check-api-docs.sh | |
parent | 437e889b18743ea4d594521829e43b6067ce9036 (diff) | |
download | systemd-3b6fd3c1dea070cb1882b8810e18a45158a356f2.tar.gz |
tools: shellcheck-ify most of the tool scripts
Diffstat (limited to 'tools/check-api-docs.sh')
-rwxr-xr-x | tools/check-api-docs.sh | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tools/check-api-docs.sh b/tools/check-api-docs.sh index 283e7a64d7..0bf053b5ff 100755 --- a/tools/check-api-docs.sh +++ b/tools/check-api-docs.sh @@ -1,31 +1,32 @@ -#!/bin/sh +#!/bin/bash # SPDX-License-Identifier: LGPL-2.1-or-later set -eu +set -o pipefail sd_good=0 sd_total=0 udev_good=0 udev_total=0 -deprecated=" +deprecated=( -e sd_bus_try_close -e sd_bus_process_priority -e sd_bus_message_get_priority -e sd_bus_message_set_priority -e sd_seat_can_multi_session -e sd_journal_open_container -" +) -for symbol in `nm -g --defined-only "$@" | grep " T " | cut -d" " -f3 | grep -wv $deprecated | sort -u` ; do - if test -f ${MESON_BUILD_ROOT}/man/$symbol.3 ; then +for symbol in $(nm -g --defined-only "$@" | grep " T " | cut -d" " -f3 | grep -wv "${deprecated[@]}" | sort -u); do + if test -f "${MESON_BUILD_ROOT:?}/man/$symbol.3"; then echo "✓ Symbol $symbol() is documented." good=1 else - printf " \x1b[1;31mSymbol $symbol() lacks documentation.\x1b[0m\n" + echo -e " \x1b[1;31mSymbol $symbol() lacks documentation.\x1b[0m" good=0 fi - case $symbol in + case "$symbol" in sd_*) ((sd_good+=good)) ((sd_total+=1)) |