File 0537-otp-Fix-codeinclude-in-reference-manual-documentatio.patch of Package erlang
From 504e601918e1c353e0d2a64058bc43ad69abe28d Mon Sep 17 00:00:00 2001
From: Lukas Larsson <lukas@erlang.org>
Date: Fri, 23 Apr 2021 15:10:54 +0200
Subject: [PATCH 07/13] otp: Fix codeinclude in reference manual documentation
Before this fix it was not possible to list an xmlsrc file
as part of REF3 in the docs.
---
lib/erl_docgen/priv/bin/codeline_preprocessing.escript | 7 +++++--
make/doc.mk | 10 ++++++++--
2 files changed, 13 insertions(+), 4 deletions(-)
diff --git a/lib/erl_docgen/priv/bin/codeline_preprocessing.escript b/lib/erl_docgen/priv/bin/codeline_preprocessing.escript
index ce9303f86e..2ee8650a18 100755
--- a/lib/erl_docgen/priv/bin/codeline_preprocessing.escript
+++ b/lib/erl_docgen/priv/bin/codeline_preprocessing.escript
@@ -109,10 +109,13 @@ get_code(File, Tag) ->
Tag ++ "\$",[global, multiline, {capture, [1], binary}]) of
{match,[[Match]]} ->
Match;
- _ ->
+ nomatch ->
+ io:format(standard_error,"Could not find the tag ~p in ~ts",
+ [Tag, File]),
halt(4)
end;
- _ ->
+ E ->
+ io:format(standard_error,"Could not read ~ts (~p)",[File, E]),
halt(3)
end.
diff --git a/make/doc.mk b/make/doc.mk
index 4acc33913c..0e12447dc9 100644
--- a/make/doc.mk
+++ b/make/doc.mk
@@ -37,9 +37,15 @@ HTML_FILES = $(XML_APPLICATION_FILES:%.xml=$(HTMLDIR)/%.html) \
$(XML_HTML_FILES:%.xml=$(HTMLDIR)/%.html) \
$(XML_PART_FILES:%.xml=$(HTMLDIR)/%.html)
-XML_ALL_REF3_FILES = $(XML_REF3_FILES) $(EDOC_REF3_FILES)
+XML_REF3_SRC_FILES=$(filter %.xmlsrc,$(XML_REF3_FILES))
+XML_REF3_XML_FILES=$(filter %.xml,$(XML_REF3_FILES))
+
+XML_ALL_REF3_FILES = $(XML_REF3_XML_FILES) $(XML_REF3_SRC_FILES:%.xmlsrc=%.xml) \
+ $(EDOC_REF3_FILES)
XML_CHAPTER_FILES += $(EDOC_CHAPTER_FILE)
-XML_GEN_FILES += $(EDOC_REF3_FILES:%=$(XMLDIR)/%) $(EDOC_CHAPTER_FILE:%=$(XMLDIR)/%)
+XML_GEN_FILES += $(EDOC_REF3_FILES:%=$(XMLDIR)/%) \
+ $(EDOC_CHAPTER_FILE:%=$(XMLDIR)/%) \
+ $(XML_REF3_SRC_FILES:%.xmlsrc=$(XMLDIR)/%.xml)
INFO_FILE = ../../info
--
2.26.2