<p>daniel has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/11133">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">osmo-config-merge: Add manual page<br><br>Change-Id: Ifaa5afe28779a805764caf76a89efb0a3169942e<br>---<br>M Makefile.am<br>M configure.ac<br>A man/Makefile.am<br>A man/osmo-config-merge.txt<br>4 files changed, 94 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/33/11133/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/Makefile.am b/Makefile.am</span><br><span>index de5eb35..745d482 100644</span><br><span>--- a/Makefile.am</span><br><span>+++ b/Makefile.am</span><br><span>@@ -1,7 +1,7 @@</span><br><span> ACLOCAL_AMFLAGS = -I m4</span><br><span> </span><br><span> AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include</span><br><span style="color: hsl(0, 100%, 40%);">-SUBDIRS = include src src/vty src/codec src/gsm src/coding src/gb src/ctrl src/sim src/pseudotalloc utils tests</span><br><span style="color: hsl(120, 100%, 40%);">+SUBDIRS = include src src/vty src/codec src/gsm src/coding src/gb src/ctrl src/sim src/pseudotalloc utils tests man</span><br><span> </span><br><span> pkgconfigdir = $(libdir)/pkgconfig</span><br><span> pkgconfig_DATA = libosmocore.pc libosmocodec.pc libosmovty.pc libosmogsm.pc \</span><br><span>diff --git a/configure.ac b/configure.ac</span><br><span>index bc3358a..c011fea 100644</span><br><span>--- a/configure.ac</span><br><span>+++ b/configure.ac</span><br><span>@@ -77,6 +77,21 @@</span><br><span> AC_PATH_PROG(DOXYGEN,doxygen,false)</span><br><span> AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false && test "x$doxygen" = "xyes")</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+AC_ARG_ENABLE([man-doc],</span><br><span style="color: hsl(120, 100%, 40%);">+          AS_HELP_STRING([--disable-man-doc], [Disable man page documentation]),</span><br><span style="color: hsl(120, 100%, 40%);">+        AS_IF([test "x$enable_man_doc" = "xno"], [enable_man_doc=no],</span><br><span style="color: hsl(120, 100%, 40%);">+                   [enable_man_doc=yes]), [enable_man_doc=yes])</span><br><span style="color: hsl(120, 100%, 40%);">+AM_CONDITIONAL([BUILD_MAN], [test "x$enable_man_doc" == "xyes"])</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+AC_CHECK_PROG(A2X, [a2x], [a2x])</span><br><span style="color: hsl(120, 100%, 40%);">+AM_CONDITIONAL([BUILD_MAN], [test -n "$A2X"])</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+AS_IF([test "$need_a2x" = "yes"], [</span><br><span style="color: hsl(120, 100%, 40%);">+      AC_CHECK_PROG(A2X, [a2x], [found], [no])</span><br><span style="color: hsl(120, 100%, 40%);">+      AS_IF([test "$A2X" != "found"],</span><br><span style="color: hsl(120, 100%, 40%);">+         [AC_MSG_ERROR([a2x not found, please install asciidoc])])</span><br><span style="color: hsl(120, 100%, 40%);">+])</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> # check for syscal fallback on glibc < 2.25 - can be removed once glibc version requirement is bumped</span><br><span> AC_CHECK_DECLS([SYS_getrandom], [], [], [[#include <sys/syscall.h>]])</span><br><span> </span><br><span>@@ -370,6 +385,7 @@</span><br><span>     libosmoctrl.pc</span><br><span>       libosmosim.pc</span><br><span>        include/Makefile</span><br><span style="color: hsl(120, 100%, 40%);">+      man/Makefile</span><br><span>         src/Makefile</span><br><span>         src/vty/Makefile</span><br><span>     src/codec/Makefile</span><br><span>diff --git a/man/Makefile.am b/man/Makefile.am</span><br><span>new file mode 100644</span><br><span>index 0000000..043c965</span><br><span>--- /dev/null</span><br><span>+++ b/man/Makefile.am</span><br><span>@@ -0,0 +1,15 @@</span><br><span style="color: hsl(120, 100%, 40%);">+if BUILD_MAN</span><br><span style="color: hsl(120, 100%, 40%);">+man_MANS =  osmo-config-merge.8</span><br><span style="color: hsl(120, 100%, 40%);">+endif</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+A2X_OPTS_MANPAGE = --doctype manpage --format manpage -D ${builddir}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ASCIIDOCS = osmo-config-merge.txt</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+osmo-config-merge.8 : ${ASCIIDOCS}</span><br><span style="color: hsl(120, 100%, 40%);">+               ${A2X} ${A2X_OPTS_MANPAGE} osmo-config-merge.txt</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+EXTRA_DIST = ${ASCIIDOCS}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+CLEANFILES = \</span><br><span style="color: hsl(120, 100%, 40%);">+            osmo-config-merge.8</span><br><span>diff --git a/man/osmo-config-merge.txt b/man/osmo-config-merge.txt</span><br><span>new file mode 100644</span><br><span>index 0000000..45c765b</span><br><span>--- /dev/null</span><br><span>+++ b/man/osmo-config-merge.txt</span><br><span>@@ -0,0 +1,62 @@</span><br><span style="color: hsl(120, 100%, 40%);">+osmo-config-merge(8)</span><br><span style="color: hsl(120, 100%, 40%);">+=====================</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+NAME</span><br><span style="color: hsl(120, 100%, 40%);">+----</span><br><span style="color: hsl(120, 100%, 40%);">+osmo-config-merge - Merge osmocom config snippets into an existing config</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+SYNOPSIS</span><br><span style="color: hsl(120, 100%, 40%);">+--------</span><br><span style="color: hsl(120, 100%, 40%);">+[verse]</span><br><span style="color: hsl(120, 100%, 40%);">+*osmo-config-merge* <config-file> <config-patch> [--debug]</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+DESCRIPTION</span><br><span style="color: hsl(120, 100%, 40%);">+-----------</span><br><span style="color: hsl(120, 100%, 40%);">+This utility allows you to merge an incremental config "patch"</span><br><span style="color: hsl(120, 100%, 40%);">+into an osmocom-style config file.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+The patch file follows the same syntax as the original config file.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+It works by appending the leaf nodes of the patch file to the respective</span><br><span style="color: hsl(120, 100%, 40%);">+nodes of the input config file.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+This process allows configuration file changes/updates to be performed</span><br><span style="color: hsl(120, 100%, 40%);">+in a more stable/reliable way than by means of (unified) diff files,</span><br><span style="color: hsl(120, 100%, 40%);">+as they break every time the context lines break.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+osmo-config-merge doesn't suffer from this problem, as it understands</span><br><span style="color: hsl(120, 100%, 40%);">+the tree-like nature of VTY config files.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+The resulting config is printed to stdout.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+NOTE: This only works with configuration files that have proper</span><br><span style="color: hsl(120, 100%, 40%);">+indenting, i.e. every level in the hierarchy must be indented excatly</span><br><span style="color: hsl(120, 100%, 40%);">+one character, not multiple.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+OPTIONS</span><br><span style="color: hsl(120, 100%, 40%);">+-------</span><br><span style="color: hsl(120, 100%, 40%);">+*--debug*::</span><br><span style="color: hsl(120, 100%, 40%);">+       Show debugging output when parsing the config tree. Needs to be the last argument.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+EXAMPLE USAGE</span><br><span style="color: hsl(120, 100%, 40%);">+-------------</span><br><span style="color: hsl(120, 100%, 40%);">+[verse]</span><br><span style="color: hsl(120, 100%, 40%);">+$ osmo-config-merge osmo-msc.cfg.base osmo-msc_change_network.cfg > osmo-msc.cfg</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+EXIT STATUS</span><br><span style="color: hsl(120, 100%, 40%);">+-----------</span><br><span style="color: hsl(120, 100%, 40%);">+Exit status is 0 if the command was successful, and 1 in case of a</span><br><span style="color: hsl(120, 100%, 40%);">+wrong/missing argument. If the tool detects an error in the patch file the</span><br><span style="color: hsl(120, 100%, 40%);">+exit status is 2.</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+SEE ALSO</span><br><span style="color: hsl(120, 100%, 40%);">+--------</span><br><span style="color: hsl(120, 100%, 40%);">+[verse]</span><br><span style="color: hsl(120, 100%, 40%);">+The official Osmocom documentation including the VTY config refernce can be</span><br><span style="color: hsl(120, 100%, 40%);">+found at: http://ftp.osmocom.org/docs/latest/</span><br><span style="color: hsl(120, 100%, 40%);">+The Osmocom wiki is located at: http://projects.osmocom.org/</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+AUTHOR</span><br><span style="color: hsl(120, 100%, 40%);">+------</span><br><span style="color: hsl(120, 100%, 40%);">+osmo-config-merge was written by Harald Welte</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/11133">change 11133</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/11133"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ifaa5afe28779a805764caf76a89efb0a3169942e </div>
<div style="display:none"> Gerrit-Change-Number: 11133 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: daniel <dwillmann@sysmocom.de> </div>