Change in osmo-gsm-manuals[master]: fix srcdir to reflect $abs_srcdir

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Fri Jan 31 15:30:13 UTC 2020


laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-gsm-manuals/+/16990 )

Change subject: fix srcdir to reflect $abs_srcdir
......................................................................

fix srcdir to reflect $abs_srcdir

When building .adoc files, we pass a srcdir variable to allow including files
that are only in the source tree, but not in the build tree.

However, so far {srcdir} is a relative path, and when an .adoc file includes an
.adoc file in a subdir, then the directive
  include::{srcdir}
is evaluated relative to the .adoc file in the subdir, not in the original make
CWD. Hence the path ends up pointing at the wrong place.

Fix this by passing an absolute path as srcdir instead.

I discovered this here:

osmo-hlr/doc/manuals/osmohlr-usermanual.adoc:
  include::{srcdir}/chapters/proxy_cache.adoc[]

osmo-hlr/doc/manuals/chapters/proxy_cache.adoc:
  ["mscgen"]
  ----
  include::{srcdir}/chapters/proxy_cache_attach.msc[]
  ----

(Note that I could have just removed "{srcdir}/chapters/" since .adoc and .msc
are in the same dir, but the point of this patch is to make {srcdir} generally
useful in all levels of included .adoc files.)

The above resulted in:

  asciidoc: include: /n/s/dev/src/osmo-hlr/doc/manuals/chapters/proxy_cache.adoc
  asciidoc: osmohlr-usermanual.adoc: line 29: reading: /n/s/dev/src/osmo-hlr/doc/manuals/chapters/proxy_cache.adoc
  asciidoc: WARNING: proxy_cache.adoc: line 263: include file not found: /n/s/dev/src/src/osmo-hlr/doc/manuals/chapters/proxy_cache_attach.msc

Note that /n/s/dev/src/src/osmo-hlr should only have one 'src' element.
With $abs_srcdir this becomes:

  asciidoc: include: /n/s/dev/make/osmo-hlr/../../src/osmo-hlr/doc/manuals/chapters/proxy_cache.adoc
  asciidoc: osmohlr-usermanual.adoc: line 29: reading: /n/s/dev/make/osmo-hlr/../../src/osmo-hlr/doc/manuals/chapters/proxy_cache.adoc
  asciidoc: include: /n/s/dev/make/osmo-hlr/../../src/osmo-hlr/doc/manuals/chapters/proxy_cache_attach.msc
  asciidoc: proxy_cache.adoc: line 263: reading: /n/s/dev/make/osmo-hlr/../../src/osmo-hlr/doc/manuals/chapters/proxy_cache_attach.msc

I have not investigated whether/why all the other 'include::' all over the
place seem to be working -- maybe we never include .adoc in subdirectories that
in turn use {srcdir}? Or we have lots of missing images we didn't notice yet?

Todo: the missing include should have fatally broken the build, but it just
builds the PDF with missing images. a) the mscgen plugin finding empty content
and b) the missing .png files should have caused the build to abort?

Change-Id: If847f16eab3ddba6009f67ed641b48805467eb1b
---
M build/Makefile.asciidoc.inc
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved



diff --git a/build/Makefile.asciidoc.inc b/build/Makefile.asciidoc.inc
index 54969fc..63c2bea 100644
--- a/build/Makefile.asciidoc.inc
+++ b/build/Makefile.asciidoc.inc
@@ -37,7 +37,7 @@
 CLEAN_FILES += $(ASCIIDOC_PDF) $(ASCIIDOC_NAME:%=%.html)
 UPLOAD_FILES += $(ASCIIDOC_PDF)
 
-ASCIIDOC_OPTS := -f $(BUILDDIR)/mscgen-filter.conf -f $(BUILDDIR)/diag-filter.conf -f $(BUILDDIR)/docinfo-releaseinfo.conf -a srcdir='$(srcdir)' -a commondir='$(COMMONDIR)'
+ASCIIDOC_OPTS := -f $(BUILDDIR)/mscgen-filter.conf -f $(BUILDDIR)/diag-filter.conf -f $(BUILDDIR)/docinfo-releaseinfo.conf -a srcdir='$(abs_srcdir)' -a commondir='$(COMMONDIR)'
 DBLATEX_OPTS := -s $(ASCIIDOCSTYLE) -P draft.mode=yes -P draft.watermark=0
 
 ifeq (,$(BUILD_RELEASE))

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-gsm-manuals/+/16990
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-gsm-manuals
Gerrit-Branch: master
Gerrit-Change-Id: If847f16eab3ddba6009f67ed641b48805467eb1b
Gerrit-Change-Number: 16990
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200131/06fc2c02/attachment.htm>


More information about the gerrit-log mailing list