diff --git a/make/doc.mk b/make/doc.mk index cfd15d765a8f..bf324ceebf34 100644 --- a/make/doc.mk +++ b/make/doc.mk @@ -64,7 +64,7 @@ include $(ERL_TOP)/make/otp_release_targets.mk release_html_spec: html $(INSTALL_DIR) "$(RELSYS_HTMLDIR)" $(INSTALL_DIR_DATA) "$(HTMLDIR)/" "$(RELSYS_HTMLDIR)" - $(ERL_TOP)/make/fixup_doc_links.sh "$(RELSYS_HTMLDIR)"/*.html + $(V_at)$(ERL_TOP)/make/fixup_doc_links.sh "$(RELSYS_HTMLDIR)"/*.html release_chunks_spec: chunks ifneq ($(CHUNK_FILES),) diff --git a/make/fixup_doc_links.sh b/make/fixup_doc_links.sh index d62248a923f9..6292f48ca0f9 100755 --- a/make/fixup_doc_links.sh +++ b/make/fixup_doc_links.sh @@ -2,11 +2,21 @@ APP_VSNS=$(head -1 ${ERL_TOP}/otp_versions.table | awk -F: '{print $2}' | sed 's:#::g') -FIXUP="-e s:system/doc/html:doc/system:g" +FIXUP="-e s:lib/../::g" + +if [ $(basename $(dirname "$1")) = "system" ]; then + ADJUST_PATH="../" +fi + +FIXUP="${FIXUP} -e s:${ADJUST_PATH}system/doc/html:doc/system:g" for APP_VSN in ${APP_VSNS}; do APP=$(echo ${APP_VSN} | awk -F- '{print $1}') - FIXUP="${FIXUP} -e s:lib/${APP}/doc/html:lib/${APP_VSN}/doc/html:g" + if [ $APP = "erts" ]; then + FIXUP="${FIXUP} -e s:${ADJUST_PATH}${APP}/doc/html/:${APP_VSN}/doc/html/:g" + else + FIXUP="${FIXUP} -e s:${ADJUST_PATH}lib/${APP}/doc/html/:lib/${APP_VSN}/doc/html/:g" + fi done set -x diff --git a/scripts/otp_check_html_links.exs b/scripts/otp_check_html_links.exs index c332bdb17865..14f4943abfda 100755 --- a/scripts/otp_check_html_links.exs +++ b/scripts/otp_check_html_links.exs @@ -17,7 +17,7 @@ defmodule Anchors do :ok end def maybe_warn(file, target, :false, suggestion) do - if not String.contains?(target,"jinterface/doc/html/assets/java") do + if not String.contains?(target,"doc/html/assets/java") do if suggestion do IO.puts("#{ file }: could not find #{ target }, should it be ##{ suggestion }?") else @@ -61,7 +61,7 @@ defmodule Anchors do end def validate_hrefs(file, document, anchors) do - if String.contains?(file,"jinterface/doc/html/assets/java") do + if String.contains?(file,"doc/html/assets/java") do :ok else for {_, attr, _} <- Floki.find(document, "a[href]") do @@ -76,8 +76,9 @@ end patterns = case System.argv do [] -> ["doc/", + "doc/system/", "lib/*/doc/html/", - "erts/doc/html/", + "erts*/doc/html/", "system/doc/html/"] patterns -> patterns end