summary refs log tree commit diff
path: root/www
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2026-02-10 18:57:24 +0000
committerJune McEnroe <june@causal.agency>2026-02-10 18:57:24 +0000
commitcad2d01ec7b77c612cf6b8d444acb39bb97caf4a (patch)
treecbddc829c7620f291faa65af8f54f621e9fd225a /www
parentAdd dais page (diff)
downloadsrc-cad2d01ec7b77c612cf6b8d444acb39bb97caf4a.tar.gz
src-cad2d01ec7b77c612cf6b8d444acb39bb97caf4a.zip
Add post-update hook for copying manuals
Diffstat (limited to 'www')
-rw-r--r--www/they.causal.agency/post-update.sh39
1 files changed, 39 insertions, 0 deletions
diff --git a/www/they.causal.agency/post-update.sh b/www/they.causal.agency/post-update.sh
new file mode 100644
index 00000000..2c0e6f54
--- /dev/null
+++ b/www/they.causal.agency/post-update.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+set -eu
+
+do_tree() {
+	tree=$1
+	manpath=$2
+	echo "Copying manuals for ${tree}..."
+	git ls-tree $tree | while read -r mode type hash name; do
+		if [ $type != blob ]; then
+			continue
+		fi
+		case "$name" in
+			(README.7)
+				continue
+				;;
+			(*.[1-9])
+				section=${name##*.}
+				mkdir -p /var/www/man/${manpath}/man${section}
+				git cat-file $type $hash \
+					>/var/www/man/${manpath}/man${section}/${name}
+		esac
+	done
+	if test -d /var/www/man/${manpath}; then
+		makewhatis /var/www/man/${manpath}
+		if ! fgrep -q ${manpath} /var/www/man/manpath.conf; then
+			echo $manpath >>/var/www/man/manpath.conf
+		fi
+	fi
+}
+
+do_tree HEAD HEAD
+
+repo=${PWD##*/}
+for tag in $(git tag); do
+	manpath=${repo%.git}-${tag}
+	if ! test -d /var/www/man/${manpath}; then
+		do_tree $tag $manpath
+	fi
+done