blob: 802f5b3c28af173b68534d1ae8e5db06ff427282 (
plain) (
blame)
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
45
46
47
48
49
50
51
52
|
#!/bin/sh
# Check that manual pages and logical binaries match up
# Need some scripts from the source directory
PATH=bin:$PATH
# Create temporary directory and implement cleanup function for it
td=
cleanup() {
rm -fr -- "$td"
}
for sig in EXIT HUP INT TERM ; do
trap cleanup "$sig"
done
td=$(mktd test-man) || exit
# Get lists of logical binaries and manual pages
for dir in bin games ; do (
cd -- "$dir"
pa *
) done |
sed 's/\...*$//' |
sort | uniq > "$td"/bin
for dir in man/man[168] ; do (
cd -- "$dir"
pa *.[168]
) done |
sed 's/\.[168]$//' |
sort | uniq > "$td"/man
# Get lists of noman scripts and nobin manual pages
comm -23 "$td"/bin "$td"/man > "$td"/noman
comm -13 "$td"/bin "$td"/man > "$td"/nobin
# Emit the content of both, if any
ex=0
if [ -s "$td"/noman ] ; then
printf >&2 'No manual pages found for:\n'
cat >&2 -- "$td"/noman
ex=1
fi
if [ -s "$td"/nobin ] ; then
printf >&2 'Stray manual page for:\n'
cat >&2 -- "$td"/nobin
ex=1
fi
# Exit appropriately
if [ "$ex" -eq 0 ] ; then
printf 'All scripts have manual pages.\n'
fi
exit "$ex"
|