threads / patch / 59433

patchdoc: remove manpage-base-url workaround

Subject: [PATCH] doc: remove manpage-base-url workaround

## tl;dr

2 messages between Mar 22, 2023 and Mar 22, 2023. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Felipe Contreras· Mar 22, 2023, 00:08 UTC · lore

Commit 50d9bbba92 (Documentation: Avoid use of xmlto --stringparam, 2009-12-04) introduced manpage-base-url.xsl because ancient versions of xmlto did not have --stringparam.

However, that was more than ten years ago, no need for that complexity anymore, we can just use --stringparam.

Cc: Todd Zullinger <tmz@pobox.com>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 Documentation/.gitignore              |  1 -
 Documentation/Makefile                |  9 ++-------
 Documentation/manpage-base-url.xsl.in | 10 ----------
 3 files changed, 2 insertions(+), 18 deletions(-)
 delete mode 100644 Documentation/manpage-base-url.xsl.in
Show changes to 3 files +2 −18

Documentation/.gitignore, Documentation/Makefile, Documentation/manpage-base-url.xsl.in

diff --git a/Documentation/.gitignore b/Documentation/.gitignore
index 1c3771e7d7..a48448de32 100644
--- a/Documentation/.gitignore
+++ b/Documentation/.gitignore
@@ -10,7 +10,6 @@ howto-index.txt
 doc.dep
 cmds-*.txt
 mergetools-*.txt
-manpage-base-url.xsl
 SubmittingPatches.txt
 tmp-doc-diff/
 GIT-ASCIIDOCFLAGS
diff --git a/Documentation/Makefile b/Documentation/Makefile
index 9c67c3a1c5..11a0093709 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -189,7 +189,7 @@ endif
 ifndef MAN_BASE_URL
 MAN_BASE_URL = file://$(htmldir)/
 endif
-XMLTO_EXTRA += -m manpage-base-url.xsl
+XMLTO_EXTRA += --stringparam man.base.url.for.relative.links='$(MAN_BASE_URL)'
 
 # If your target system uses GNU groff, it may try to render
 # apostrophes as a "pretty" apostrophe using unicode.  This breaks
@@ -339,7 +339,6 @@ clean:
 	$(RM) technical/*.html technical/api-index.txt
 	$(RM) SubmittingPatches.txt
 	$(RM) $(cmds_txt) $(mergetools_txt) *.made
-	$(RM) manpage-base-url.xsl
 	$(RM) GIT-ASCIIDOCFLAGS
 
 $(MAN_HTML): %.html : %.txt $(ASCIIDOC_DEPS)
@@ -348,11 +347,7 @@ $(MAN_HTML): %.html : %.txt $(ASCIIDOC_DEPS)
 $(OBSOLETE_HTML): %.html : %.txto $(ASCIIDOC_DEPS)
 	$(QUIET_ASCIIDOC)$(TXT_TO_HTML) -o $@ $<
 
-manpage-base-url.xsl: manpage-base-url.xsl.in
-	$(QUIET_GEN)sed "s|@@MAN_BASE_URL@@|$(MAN_BASE_URL)|" $< > $@
-
-
-manpage-prereqs := manpage-base-url.xsl $(wildcard manpage*.xsl)
+manpage-prereqs := $(wildcard manpage*.xsl)
 manpage-cmd = $(QUIET_XMLTO)$(XMLTO) -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
 
 %.1 : %.xml $(manpage-prereqs)
diff --git a/Documentation/manpage-base-url.xsl.in b/Documentation/manpage-base-url.xsl.in
deleted file mode 100644
index e800904df3..0000000000
--- a/Documentation/manpage-base-url.xsl.in
+++ /dev/null
@@ -1,10 +0,0 @@
-<!-- manpage-base-url.xsl:
-     special settings for manpages rendered from newer docbook -->
-<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-		version="1.0">
-
-<!-- set a base URL for relative links -->
-<xsl:param name="man.base.url.for.relative.links"
-	>@@MAN_BASE_URL@@</xsl:param>
-
-</xsl:stylesheet>
-- 
2.39.2.13.g1fb56cf030
Todd Zullinger· Mar 22, 2023, 01:24 UTC · re: Felipe Contreras · lore

Re: [PATCH] doc: remove manpage-base-url workaround

Felipe Contreras wrote:
Show 6 quoted lines
> Commit 50d9bbba92 (Documentation: Avoid use of xmlto --stringparam,
> 2009-12-04) introduced manpage-base-url.xsl because ancient versions of
> xmlto did not have --stringparam.
> 
> However, that was more than ten years ago, no need for that complexity
> anymore, we can just use --stringparam.

Sounds good. The issue at the time was with xmlto older than ~ 0.20. It was known that 0.18 didn't work, which affected both openSUSE 11.2 and CentOS 5, as reported in https://lore.kernel.org/git/m2hbs85koj.fsf@igel.home/ and the following messages).

I wish I'd have included the details on which xmlto versions were affected in the commit message. The project was managed in SVN at the time and I can't (easily) find the source older than it's import to git around 0.21.

Not that it's important. It was already rather old versions of xmlto which were affected -- in 2009.

Thanks,
-- 
Todd

← back to recent threads