aboutsummaryrefslogtreecommitdiff
path: root/aux/workflow/assert-manpages.sh
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2021-06-14 16:29:50 -0300
committerEuAndreh <eu@euandre.org>2021-06-14 16:29:50 -0300
commit1ecf9b99c671895badb0dd665580596fae97abc4 (patch)
tree72c05b203ad1abfa498d539764b689c6cd0fddcc /aux/workflow/assert-manpages.sh
parentaux/guix/manifest.scm: Remove unused packages (diff)
downloadgit-permalink-1ecf9b99c671895badb0dd665580596fae97abc4.tar.gz
git-permalink-1ecf9b99c671895badb0dd665580596fae97abc4.tar.xz
aux/: Update
Diffstat (limited to 'aux/workflow/assert-manpages.sh')
-rw-r--r--aux/workflow/assert-manpages.sh45
1 files changed, 34 insertions, 11 deletions
diff --git a/aux/workflow/assert-manpages.sh b/aux/workflow/assert-manpages.sh
index 712a2bb..add7f47 100644
--- a/aux/workflow/assert-manpages.sh
+++ b/aux/workflow/assert-manpages.sh
@@ -3,42 +3,65 @@ set -eu
PROJECT="$1"
MAILING_LIST="$2"
+shift
+shift
TLD="$(cat aux/tld.txt)"
+IN_PLACE=false
+while getopts 'i' flag; do
+ case "$flag" in
+ i)
+ IN_PLACE=true
+ ;;
+ *)
+ ;;
+ esac
+done
+
EXPECTED="$(mktemp)"
cat <<EOF >> "$EXPECTED"
.
.
.SH AUTHORS
.P
-EuAndreh
.MT eu@euandre.org
+EuAndreh
.ME
and contributors.
.
.
.SH BUGS
-Report bugs to:
+Report bugs to the
.MT ~euandreh/$MAILING_LIST@lists.sr.ht
-.ME
+mailing list
+.ME .
.br
-Browse bugs at:
+Browse bugs
.UR https://$TLD/$PROJECT/TODOs.html
-.UE
+online
+.UE .
.br
-Home page:
.UR https://$TLD/$PROJECT/
-.UE
+Home page
+.UE .
.br
-Discussions:
-.UR https://lists.sr.ht/~euandreh/$MAILING_LIST?search=[$PROJECT]
-.UE
+.UR https://lists.sr.ht/~euandreh/$MAILING_LIST?search=%5Bfallible%5D
+Comments and discussions
+.UE .
EOF
# shellcheck disable=2044
for f in $(find doc -type f -name '*.[0-9]'); do
+ LINES="$(wc -l "$f" | cut -d\ -f1)"
+ if [ "$LINES" = 1 ] && grep -Eq '^\.so man.+$' "$f"; then
+ continue
+ fi
if ! tail -n "$(wc -l < "$EXPECTED")" "$f" | diff - "$EXPECTED"; then
echo "Missing metadata at the end of \"$f\" file"
- exit 1
+ if [ "$IN_PLACE" = true ]; then
+ cat "$EXPECTED" >> "$f"
+ else
+ exit 1
+ fi
fi
done