From: Ben Hutchings <ben@decadent.org.uk>
To: Peter Zijlstra <peterz@infradead.org>,
Ingo Molnar <mingo@redhat.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
Salvatore Bonaccorso <carnil@debian.org>
Subject: [PATCH v2 1/2] perf doc: Define man page date when using asciidoctor
Date: Sat, 13 May 2023 22:37:24 +0200 [thread overview]
Message-ID: <ZF/1BOahN/i6xbBx@decadent.org.uk> (raw)
In-Reply-To: <ZF/0jJkAOXxzGAMc@decadent.org.uk>
[-- Attachment #1: Type: text/plain, Size: 1902 bytes --]
From: Ben Hutchings <benh@debian.org>
When building perf documentation with asciidoc, we use "git log" to
find the last commit date of each doc source and pass that to asciidoc
to use as the man page date.
When using asciidoctor, however, the current date is always used
instead. Defining perf_date like we do for asciidoc also doesn't
work because we're not using DocBook as an intermediate format.
The asciidoctor man page backend looks for the variable "docdate",
so set that instead.
Signed-off-by: Ben Hutchings <benh@debian.org>
---
tools/perf/Documentation/Makefile | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/tools/perf/Documentation/Makefile b/tools/perf/Documentation/Makefile
index ba5d942e4c6a..8a7d7078e386 100644
--- a/tools/perf/Documentation/Makefile
+++ b/tools/perf/Documentation/Makefile
@@ -250,11 +250,16 @@ $(MAN_HTML): $(OUTPUT)%.html : %.txt
$(ASCIIDOC_EXTRA) -aperf_version=$(PERF_VERSION) -o $@+ $< && \
mv $@+ $@
+# Generate date from git log of the doc input file
+PERF_DATE = $(shell git log -1 --pretty="format:%cd" \
+ --date=short --no-show-signature $<)
+
ifdef USE_ASCIIDOCTOR
$(OUTPUT)%.1 $(OUTPUT)%.5 $(OUTPUT)%.7 : %.txt
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
$(ASCIIDOC) -b manpage -d manpage \
- $(ASCIIDOC_EXTRA) -aperf_version=$(PERF_VERSION) -o $@+ $< && \
+ $(ASCIIDOC_EXTRA) -aperf_version=$(PERF_VERSION) \
+ -adocdate=$(PERF_DATE) -o $@+ $< && \
mv $@+ $@
endif
@@ -266,9 +271,7 @@ $(OUTPUT)%.xml : %.txt
$(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
$(ASCIIDOC) -b docbook -d manpage \
$(ASCIIDOC_EXTRA) -aperf_version=$(PERF_VERSION) \
- -aperf_date=$(shell git log -1 --pretty="format:%cd" \
- --date=short --no-show-signature $<) \
- -o $@+ $< && \
+ -aperf_date=$(PERF_DATE) -o $@+ $< && \
mv $@+ $@
XSLT = docbook.xsl
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2023-05-13 20:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-13 20:35 [PATCH v2 0/2] perf doc improvements to man page reproducibility Ben Hutchings
2023-05-13 20:37 ` Ben Hutchings [this message]
2023-05-13 20:37 ` [PATCH v2 2/2] perf doc: Add support for KBUILD_BUILD_TIMESTAMP Ben Hutchings
[not found] ` <CAP-5=fXmL509c2rhE7SYj9FW62eZPc7tPEWzG1h0DztF+Qmnww@mail.gmail.com>
2023-05-15 20:49 ` [PATCH v2 0/2] perf doc improvements to man page reproducibility Arnaldo Carvalho de Melo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZF/1BOahN/i6xbBx@decadent.org.uk \
--to=ben@decadent.org.uk \
--cc=acme@kernel.org \
--cc=carnil@debian.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®