<p>osmith has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/osmo-gsm-manuals/+/16403">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">Support multiple VTY reference manuals<br><br>Adjust vty_reference_combine.sh, so we can change the output dir from<br>"generated" to a subdir inside "generated" when building anything but<br>the first VTY reference.<br><br>Add a generic pattern to Makefile.vty-reference for additional VTY<br>references, that uses slightly different paths compared to the first VTY<br>reference, in order to avoid collisions.<br><br>Related: OS#4292<br>Change-Id: I4dea3e07b88175b2a88e577129360af7ec5f87e1<br>---<br>M build/Makefile.vty-reference.inc<br>M build/vty_reference_combine.sh<br>2 files changed, 41 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/03/16403/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/build/Makefile.vty-reference.inc b/build/Makefile.vty-reference.inc</span><br><span>index 0129a5c..90ef8e6 100644</span><br><span>--- a/build/Makefile.vty-reference.inc</span><br><span>+++ b/build/Makefile.vty-reference.inc</span><br><span>@@ -22,15 +22,36 @@</span><br><span> #</span><br><span> # This uses the Makefile.docbook.inc, you should not mix uses of</span><br><span> # Makefile.vty-reference.inc and Makefile.docbook.inc.</span><br><span style="color: hsl(120, 100%, 40%);">+#</span><br><span style="color: hsl(120, 100%, 40%);">+# In order to add more than one VTY reference, do this for each additional one:</span><br><span style="color: hsl(120, 100%, 40%);">+# - Extend VTY_REFERENCE with the new entry, make sure it ends in "-vty-reference":</span><br><span style="color: hsl(120, 100%, 40%);">+#    VTY_REFERENCE = osmofoo-vty-reference.xml osmobar-vty-reference.xml</span><br><span style="color: hsl(120, 100%, 40%);">+# - Create a new osmobar-vty-reference.xml file, just like osmofoo-vty-reference.xml, but with</span><br><span style="color: hsl(120, 100%, 40%);">+#   "generated/docbook_osmobar-vty-reference.xml" as sections-vty path instead of</span><br><span style="color: hsl(120, 100%, 40%);">+#   "generated/docbook_vty.xml".</span><br><span style="color: hsl(120, 100%, 40%);">+# - Create vty-osmobar/*_additions.xml and vty-osmobar/*_reference.xml. Pay attention to the</span><br><span style="color: hsl(120, 100%, 40%);">+#   directory name, it must start with vty-osmo* instead of "vty" and it must match the prefix</span><br><span style="color: hsl(120, 100%, 40%);">+#   of your new VTY_REFERENCE entry (osmofoo in this example).</span><br><span style="color: hsl(120, 100%, 40%);">+# - Full example: osmo-sgsn.git I24c3ca2fc2446673edceefb797c7d800c3a1a5d2</span><br><span> </span><br><span> DOCBOOKS = $(VTY_REFERENCE)</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# First VTY reference</span><br><span> DOCBOOKS_DEPS = generated/docbook_vty.xml</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+# Additional VTY references: append "generated/docbook_" prefix</span><br><span style="color: hsl(120, 100%, 40%);">+# For example:</span><br><span style="color: hsl(120, 100%, 40%);">+# VTY_REFERENCE = osmosgsn-vty-reference.xml osmogbproxy-vty-reference.xml</span><br><span style="color: hsl(120, 100%, 40%);">+# DOCBOOK_DEPS = generated/docbook_vty.xml generated/docbook_osmogbproxy-vty-reference.xml</span><br><span style="color: hsl(120, 100%, 40%);">+DOCBOOKS_DEPS += $(patsubst %,generated/docbook_%,$(filter-out $(firstword $(VTY_REFERENCE)),$(VTY_REFERENCE)))</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.docbook.inc</span><br><span> </span><br><span> MERGE_DOC = $(shell realpath $(OSMO_GSM_MANUALS_DIR)/merge_doc.xsl)</span><br><span> </span><br><span> CLEAN_FILES += generated</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+# First VTY reference</span><br><span> generated/docbook_vty.xml: \</span><br><span>                            $(srcdir)/vty/*xml \</span><br><span>                         $(OSMO_GSM_MANUALS_DIR)/common/vty_additions.xml \</span><br><span>@@ -42,3 +63,16 @@</span><br><span>           $(srcdir)/vty/*additions*.xml</span><br><span>        xsltproc $(OSMO_GSM_MANUALS_DIR)/vty_reference.xsl generated/combined.xml \</span><br><span>          > generated/docbook_vty.xml</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+generated/docbook_%-vty-reference.xml: \</span><br><span style="color: hsl(120, 100%, 40%);">+                     $(srcdir)/vty-%/*xml \</span><br><span style="color: hsl(120, 100%, 40%);">+                        $(OSMO_GSM_MANUALS_DIR)/common/vty_additions.xml \</span><br><span style="color: hsl(120, 100%, 40%);">+                    $(OSMO_GSM_MANUALS_DIR)/common/chapters/vty.xml \</span><br><span style="color: hsl(120, 100%, 40%);">+                     $(OSMO_GSM_MANUALS_DIR)/vty_reference.xsl</span><br><span style="color: hsl(120, 100%, 40%);">+    export VTYDIR="$(srcdir)/vty-$(patsubst generated/docbook_%-vty-reference.xml,%,$@)" && \</span><br><span style="color: hsl(120, 100%, 40%);">+   export VTYGEN="$@_combine" && \</span><br><span style="color: hsl(120, 100%, 40%);">+     $(OSMO_GSM_MANUALS_DIR)/build/vty_reference_combine.sh "$(MERGE_DOC)" \</span><br><span style="color: hsl(120, 100%, 40%);">+             $$VTYDIR/*reference.xml \</span><br><span style="color: hsl(120, 100%, 40%);">+             $(OSMO_GSM_MANUALS_DIR)/common/vty_additions.xml \</span><br><span style="color: hsl(120, 100%, 40%);">+            $$VTYDIR/*additions*.xml && \</span><br><span style="color: hsl(120, 100%, 40%);">+ xsltproc $(OSMO_GSM_MANUALS_DIR)/vty_reference.xsl $$VTYGEN/combined.xml > "$@"</span><br><span>diff --git a/build/vty_reference_combine.sh b/build/vty_reference_combine.sh</span><br><span>index 449b227..6ab279e 100755</span><br><span>--- a/build/vty_reference_combine.sh</span><br><span>+++ b/build/vty_reference_combine.sh</span><br><span>@@ -3,6 +3,10 @@</span><br><span> # see Makefile.vty-reference.inc</span><br><span> set -e</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+# Allow overriding the "generated" output dir, so we don't have collisions when building multiple VTY references in one</span><br><span style="color: hsl(120, 100%, 40%);">+# Osmocom project (OS#4292)</span><br><span style="color: hsl(120, 100%, 40%);">+VTYGEN=${VTYGEN:-generated}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> # first argument: merge_doc.xsl</span><br><span> MERGE_DOC="$1"</span><br><span> shift</span><br><span>@@ -12,11 +16,11 @@</span><br><span> test "$(ls -1 $reference | wc -l)" = "1"</span><br><span> shift</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-combined="generated/combined.xml"</span><br><span style="color: hsl(0, 100%, 40%);">-combine_src="generated/combine_src.xml"</span><br><span style="color: hsl(120, 100%, 40%);">+combined="$VTYGEN/combined.xml"</span><br><span style="color: hsl(120, 100%, 40%);">+combine_src="$VTYGEN/combine_src.xml"</span><br><span> </span><br><span> set -x</span><br><span style="color: hsl(0, 100%, 40%);">-mkdir -p generated</span><br><span style="color: hsl(120, 100%, 40%);">+mkdir -p "$VTYGEN"</span><br><span> cp $reference "$combined"</span><br><span> </span><br><span> while [ -n "$1" ]; do</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-gsm-manuals/+/16403">change 16403</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-gsm-manuals/+/16403"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-gsm-manuals </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I4dea3e07b88175b2a88e577129360af7ec5f87e1 </div>
<div style="display:none"> Gerrit-Change-Number: 16403 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>