aboutsummaryrefslogtreecommitdiffstats
path: root/utils/osmo-config-merge.c
AgeCommit message (Collapse)AuthorFilesLines
2021-12-14treewide: remove FSF addressOliver Smith1-4/+0
Remove the paragraph about writing to the Free Software Foundation's mailing address. The FSF has changed addresses in the past, and may do so again. In 2021 this is not useful, let's rather have a bit less boilerplate at the start of source files. Change-Id: I5050285e75cf120407a1d883e99b3c4bcae8ffd7
2019-02-22Add multipatch capability to osmo-config-mergeMax1-21/+45
That's pretty straightforward and convenient extention: handle all extra positional arguments as patch file names. This makes it similar to 'cp' and other coreutils basic tools. For example: osmo-config-merge base.cfg patch1.cfg patch2.cfg patch3.cfg will apply 3 patches to the base config file. Change-Id: I212cbdc3bf6f251c1a3175737ac74242fb004c6d
2018-10-21osmo-config-merge: fclose() what we fopen()Harald Welte1-0/+2
Change-Id: Ib44f902e5bca2277f1b340d34fabbd2a298d683e Fixes: Coverity CID#188851
2018-09-28osmo-config-merge: Fix some small issuesDaniel Willmann1-4/+15
Allocate NULL context after exit_usage() calls and free it before exit so * sanitizer is happy. Also handle the error cases gracefully when a file is unreadable or formatted wrong. Change-Id: I966e63a3f7d0ff71ee0b88922aa3807d073aa232
2018-09-27utils/osmo-config-merge: explicitly return from main()Vadim Yanitskiy1-0/+2
This change fixes the following compiler warning: osmo-config-merge.c: In function ‘main’: osmo-config-merge.c:268:1: warning: control reaches end of non-void function [-Wreturn-type] Despite it isn't critical, let's get rid of this warning. Change-Id: I7a80a85c8b3180dc086cd9fd20356aab16ea8100
2018-09-25osmo-config-merge: Don't use C99 'for' loop initial declarationsHarald Welte1-2/+4
The existing code passed gerrit build verification but failed the master builds with the following error: osmo-config-merge.c:148:4: error: 'for' loop initial declarations are only allowed in C99 or C11 mode for (int i = 0; i < cur_indent - indent; i++) { ^ osmo-config-merge.c:148:4: note: use option -std=c99, -std=gnu99, -std=c11 or -std=gnu11 to compile your code Change-Id: Ia29e85b648c1a427be88242306634efe890e250d
2018-09-25Add new osmo-config-merge utilityHarald Welte1-0/+266
This utility allows you to merge an incremental config "patch" into an osmocom-style config file. The patch file follows the same syntax as the original config file. It works by appending the leaf nodes of the patch file to the respective nodes of the input config file. This process allows configuration file changes/updates to be performed in a more stable/reliable way than by means of [unified] diff files, as they break every time the context lines break. osmo-config-merge doesn't suffer from this problem, as it understands the tree-like nature of VTY config files. NITE: This only works with configuration files that have proper indenting, i.e. every level in the hierarchy must be indented excatly one character, not multiple. Change-Id: I61997a3668cc3a40d12ca023272f6d782e6fbefe