File 0244-erl_docgen-Fix-ghlinks-to-.xmlsrc.patch of Package erlang

From 63eef4c488c46d3b4957fbbf155158f1af8180ed Mon Sep 17 00:00:00 2001
From: Lukas Larsson <lukas@erlang.org>
Date: Fri, 6 Apr 2018 17:09:04 +0200
Subject: [PATCH 4/8] erl_docgen: Fix ghlinks to .xmlsrc

---
 lib/erl_docgen/priv/bin/codeline_preprocessing.escript | 3 +--
 make/otp.mk.in                                         | 5 ++---
 make/otp_release_targets.mk                            | 6 +++++-
 system/doc/programming_examples/Makefile               | 3 ---
 system/doc/system_principles/Makefile                  | 3 ---
 system/doc/tutorial/Makefile                           | 3 ---
 6 files changed, 8 insertions(+), 15 deletions(-)

diff --git a/lib/erl_docgen/priv/bin/codeline_preprocessing.escript b/lib/erl_docgen/priv/bin/codeline_preprocessing.escript
index 8e1e35bcdd..67966b79e6 100755
--- a/lib/erl_docgen/priv/bin/codeline_preprocessing.escript
+++ b/lib/erl_docgen/priv/bin/codeline_preprocessing.escript
@@ -30,7 +30,7 @@
 %% Function: main/1
 %% Description:
 %%----------------------------------------------------------------------
-main([InFile, OutFile]) ->
+main([CPath, InFile, OutFile]) ->
     InDev = 
 	case file:open(InFile, [read]) of
 	    {ok,ID} ->
@@ -38,7 +38,6 @@ main([InFile, OutFile]) ->
 	    _ ->
 		halt(5)
 	end,
-    CPath=filename:dirname(InFile),
     OutDev = 
 	case file:open(OutFile, [write]) of
 	    {ok,OD} ->
diff --git a/make/otp.mk.in b/make/otp.mk.in
index 6692b575ff..c514a150ca 100644
--- a/make/otp.mk.in
+++ b/make/otp.mk.in
@@ -303,9 +303,8 @@ $(MAN6DIR)/%.6 $(MAN6DIR)/%.7: $(XMLDIR)/%_app.xml
 	$(gen_verbose)date=`date +"%B %e, %Y"`; \
 	xsltproc --output "$@" $(MANXSLTARGS) $(DOCGEN)/priv/xsl/db_man.xsl $<
 
-
-$(XMLDIR)/%.xml: %.xmlsrc
-	$(gen_verbose)escript $(DOCGEN)/priv/bin/codeline_preprocessing.escript $< $@
+$(XMLDIR)/%.xml: $(XMLDIR)/%.xmlsrc
+	$(gen_verbose)escript $(DOCGEN)/priv/bin/codeline_preprocessing.escript $(shell pwd) $< $@
 
 .fo.pdf:
 	$(FOP) -c $(FOP_CONFIG) -cache $(ERL_TOP)/make/$(TARGET)/fop-fonts.cache -fo $< -pdf $@
diff --git a/make/otp_release_targets.mk b/make/otp_release_targets.mk
index 9a6384af59..5ba025d98b 100644
--- a/make/otp_release_targets.mk
+++ b/make/otp_release_targets.mk
@@ -40,7 +40,11 @@ _create_xml_dirs := $(shell mkdir -p $(XMLDIR))
 
 XML_GEN_FILES+=$(patsubst %.xml,$(XMLDIR)/%.xml,$(XML_FILES))
 $(XMLDIR)/%.xml: %.xml
-	$(gen_verbose)escript $(DOCGEN)/priv/bin/github_link.escript $^ \
+	$(gen_verbose)escript $(DOCGEN)/priv/bin/github_link.escript $< \
+	"$(subst $(ERL_TOP)/,,$(CURDIR)/$^)" "$(shell git rev-parse HEAD)" $@
+
+$(XMLDIR)/%.xmlsrc: %.xmlsrc
+	$(gen_verbose)escript $(DOCGEN)/priv/bin/github_link.escript $< \
 	"$(subst $(ERL_TOP)/,,$(CURDIR)/$^)" "$(shell git rev-parse HEAD)" $@
 
 ifeq ($(TOPDOC),)
diff --git a/system/doc/programming_examples/Makefile b/system/doc/programming_examples/Makefile
index cb028b61df..af731f85b4 100644
--- a/system/doc/programming_examples/Makefile
+++ b/system/doc/programming_examples/Makefile
@@ -88,9 +88,6 @@ clean clean_docs:
 	rm -f $(TOP_PDF_FILE) $(TOP_PDF_FILE:%.pdf=%.fo)
 	rm -f errs core *~ 
 
-$(XMLDIR)/%.xml: %.xmlsrc
-	 $(gen_verbose)escript $(DOCGEN)/priv/bin/codeline_preprocessing.escript $< $@
-
 # ----------------------------------------------------
 # Release Target
 # ---------------------------------------------------- 
diff --git a/system/doc/system_principles/Makefile b/system/doc/system_principles/Makefile
index 927cd70985..ec6591ec6b 100644
--- a/system/doc/system_principles/Makefile
+++ b/system/doc/system_principles/Makefile
@@ -85,9 +85,6 @@ clean clean_docs:
 	rm -f $(TOP_PDF_FILE) $(TOP_PDF_FILE:%.pdf=%.fo)
 	rm -f errs core *~ 
 
-$(XMLDIR)/%.xml: %.xmlsrc
-	 $(gen_verbose)escript $(DOCGEN)/priv/bin/codeline_preprocessing.escript $< $@
-
 # ----------------------------------------------------
 # Release Target
 # ---------------------------------------------------- 
diff --git a/system/doc/tutorial/Makefile b/system/doc/tutorial/Makefile
index fbdb5e5a89..606064da72 100644
--- a/system/doc/tutorial/Makefile
+++ b/system/doc/tutorial/Makefile
@@ -113,9 +113,6 @@ clean clean_docs:
 	rm -f $(TOP_PDF_FILE) $(TOP_PDF_FILE:%.pdf=%.fo)
 	rm -f errs core *~ 
 
-$(XMLDIR)/%.xml: %.xmlsrc
-	 $(gen_verbose)escript $(DOCGEN)/priv/bin/codeline_preprocessing.escript $< $@
-
 # ----------------------------------------------------
 # Release Target
 # ---------------------------------------------------- 
-- 
2.16.3

openSUSE Build Service is sponsored by