blob: cd509954ad3e4297fb4d96022459457134ed36aa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
#!/bin/bash
set -e
: "${TEST_SRCDIR:?}"
TOP_SRCDIR=`cd "${TEST_SRCDIR}/.." && pwd`
README="${TOP_SRCDIR}/README.md"
MAN_DIR="${TOP_SRCDIR}/man"
fail()
{
echo "tst-doc-version-policy: $*" >&2
exit 1
}
# README is a current-interface document, not a release changelog. Keep
# package release numbers in NEWS/ChangeLog and obtain the installed version
# from the tools themselves.
if grep -E 'LibMCPU [0-9]+\.[0-9]+\.[0-9]+|libmcpu-[0-9]+\.[0-9]+\.[0-9]+' \
"${README}" >/dev/null ; then
fail "README.md contains a release-bound LibMCPU version string"
fi
# Manual pages describe the interface contract. Their .TH source field is
# deliberately version-independent so a release bump cannot leave stale
# numbers behind.
while IFS= read -r page ; do
header=`sed -n '1p' "${page}"`
case "${header}" in
*'"LibMCPU"'*)
;;
*)
fail "${page}: .TH source field is not version-independent"
;;
esac
done < <(find "${MAN_DIR}" -type f \( -name '*.1' -o -name '*.7' \) | sort)
if grep -ER 'LibMCPU [0-9]+\.[0-9]+\.[0-9]+' "${MAN_DIR}" >/dev/null ; then
fail "manual page contains a release-bound LibMCPU version string"
fi
exit 0
|