summaryrefslogtreecommitdiff
path: root/man
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-03-23 20:39:23 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-03-27 20:12:44 +0100
commit3919ecc55358815e2997d7212552251ffd478633 (patch)
treee84b5dc30a26f0ddfaebf9f7ea36f018f5d71ffb /man
parent51327bcc7457abb05cc80a5744fc233778a08ff8 (diff)
downloadsystemd-3919ecc55358815e2997d7212552251ffd478633.tar.gz
meson: run a no-op build to generate man rules
When a new page is added using man/update-man-rules, ninja doesn't know about the new target until a build is initiated, so build/man/man and build/man/html would fail. Force a trivial build to regenerate the rules before calling 'ninja -t'.
Diffstat (limited to 'man')
-rwxr-xr-xman/html.in3
-rwxr-xr-xman/man.in3
2 files changed, 6 insertions, 0 deletions
diff --git a/man/html.in b/man/html.in
index bc9a668c23..c09d300d6f 100755
--- a/man/html.in
+++ b/man/html.in
@@ -6,6 +6,9 @@ if [ -z "$1" ]; then
exit 1
fi
+# make sure the rules have been regenrated (in case man/update-man-rules was just run)
+ninja -C "@BUILD_ROOT@" version.h
+
target="man/$1.html"
ninja -C "@BUILD_ROOT@" "$target"
set -x
diff --git a/man/man.in b/man/man.in
index 75680b860c..812c6767fc 100755
--- a/man/man.in
+++ b/man/man.in
@@ -6,6 +6,9 @@ if [ -z "$1" ]; then
exit 1
fi
+# make sure the rules have been regenrated (in case man/update-man-rules was just run)
+ninja -C "@BUILD_ROOT@" version.h
+
page="$(echo "$1" | sed 's/\./\\./')"
target=$(ninja -C "@BUILD_ROOT@" -t query man/man | grep -E -m1 "man/$page\.[0-9]$" | awk '{print $2}')
if [ -z "$target" ]; then