summary refs log tree commit diff
path: root/www/they.causal.agency
diff options
context:
space:
mode:
Diffstat (limited to 'www/they.causal.agency')
-rw-r--r--www/they.causal.agency/Makefile4
-rw-r--r--www/they.causal.agency/post-update.sh41
2 files changed, 45 insertions, 0 deletions
diff --git a/www/they.causal.agency/Makefile b/www/they.causal.agency/Makefile
new file mode 100644
index 00000000..81f47ea9
--- /dev/null
+++ b/www/they.causal.agency/Makefile
@@ -0,0 +1,4 @@
+ROOT = /var/www/man
+
+install: post-update.sh
+	install post-update.sh ${ROOT}/post-update
diff --git a/www/they.causal.agency/post-update.sh b/www/they.causal.agency/post-update.sh
new file mode 100644
index 00000000..db2d5936
--- /dev/null
+++ b/www/they.causal.agency/post-update.sh
@@ -0,0 +1,41 @@
+#!/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
+			sort -o /var/www/man/manpath.conf /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