summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorAlejandro Colomar <alx.manpages@gmail.com>2022-04-15 22:21:11 +0200
committerAlejandro Colomar <alx.manpages@gmail.com>2022-05-02 23:29:23 +0200
commitcd34c839d3c9878db9105714b1e460f30057e7f2 (patch)
tree6134ff7a74562cb2eaea918950739e1976142167 /scripts
parent0299c88b6435f6fca5a516b488628ac3ff09a0e5 (diff)
scripts/append_COLOPHON.sh: Add script to append the COLOPHON section
I first implemented it using cat <<-, but sed(1) is around 5 times faster, so even if it's a bit more complex and slightly less readable, let's use sed(1). Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/append_COLOPHON.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/scripts/append_COLOPHON.sh b/scripts/append_COLOPHON.sh
new file mode 100755
index 000000000..f277b997f
--- /dev/null
+++ b/scripts/append_COLOPHON.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+#
+# append_COLOPHON.sh
+#
+# Append the COLOPHON section to the man pages. This script should be
+# run before running `make dist`.
+#
+########################################################################
+# SPDX-License-Identifier: GPL-2.0-only
+########################################################################
+#
+# (C) Copyright 2022, Alejandro Colomar
+# These functions are free software; you can redistribute them and/or
+# modify them under the terms of the GNU General Public License
+# as published by the Free Software Foundation; version 2.
+#
+# These functions are distributed in the hope that they will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details
+# (http://www.gnu.org/licenses/gpl-2.0.html).
+#
+########################################################################
+find man?/ -not -type d \
+|xargs sed -i "\$a \\
+.SH COLOPHON\\
+This page is part of release\\
+$(git describe | sed 's/^man-pages-//')\\
+of the Linux\\
+.I man-pages\\
+project.\\
+A description of the project,\\
+information about reporting bugs,\\
+and the latest version of this page,\\
+can be found at\\
+.UR https://www.kernel.org/doc/man-pages/\\
+.UE .
+"