Skip to main content

FSmerge

About

FreeSWITCH has long needed a mechanism to update the installed configuration files and merge in
any local changes. This script is designed to fit that need, in an optional manner.

It is based on sysmerge(8) from OpenBSD, which is based on mergemaster(8) from FreeBSD.

Click here to expand Table of Contents

Conference Call About fsmerge

John talks about fsmerge Listen

Download

Until committed to the FS repository, it is available here.

Usage

 $ fsmerge [-h] [-s src] [-d dst]
  • -h: help
  • -s src: source directory tree (ie: /home/username/freeswitch-src/conf)
  • -d dst: destination directory tree (ie: /usr/local/freeswitch/conf)

Ideas

  • A 'make merge' target from the top-level source directory, automatically running with the correct parameters.

Optional Patches

  • Apply this from toplevel-src before running bootstrap/configure, it adds a "make merge" target, shown below in the 'Example Session'.
Index: Makefile.am
===================================================================
--- Makefile.am (revision 17539)
+++ Makefile.am (working copy)
@@ -650,3 +650,6 @@
@cp support-d/.screenrc ~
@cp support-d/.bashrc ~
@test -f ~/.cc-mode-installed || sh support-d/install-cc-mode.sh && touch ~/.cc-mode-installed
+
+merge:
+ @./scripts/fsmerge -s $(switch_builddir)/conf -d $(prefix)/conf

Example Session

_:jontow@apex:~/SVN-freeswitch% make merge

===> Running fsmerge with the following settings:

source: /usr/home/jontow/SVN-freeswitch/conf
destination: /usr/local/freeswitch/conf

base work directory: /tmp/fsmerge.MyBlF
temp root directory: /tmp/fsmerge.MyBlF/temproot
backup directory: /tmp/fsmerge.MyBlF/backups

Continue? (y|[n]) y

===> Creating and populating temporary root under
/tmp/fsmerge.MyBlF/temproot

===> Starting comparison

========================================================================

===> /usr/local/freeswitch/conf/autoload_configs/nibblebill.conf.xml was not found on the target system


Use 'd' to delete the temporary ./autoload_configs/nibblebill.conf.xml
Use 'i' to install the temporary ./autoload_configs/nibblebill.conf.xml

Default is to leave the temporary file to deal with by hand

How should I deal with this? [Leave it for later] i

===> ./autoload_configs/nibblebill.conf.xml installed successfully

========================================================================

===> Displaying differences between ./autoload_configs/enum.conf.xml and installed version:

--- /usr/local/freeswitch/conf/autoload_configs/enum.conf.xml Fri May 22 14:03:22 2009
+++ ./autoload_configs/enum.conf.xml Tue May 18 20:15:05 2010
@@ -8,7 +8,6 @@

<routes>
<route service="E2U+SIP" regex="sip:(.*)" replace="sofia/${use_profile}/$1"/>
- <!--<route service="E2U+IAX2" regex="iax2:(.*)" replace="iax/$1"/>-->
<!--<route service="E2U+XMPP" regex="XMPP:(.*)" replace="dingaling/$${xmpp_server_profile}/$1"/>-->
</routes>
</configuration>

Use 'd' to delete the temporary ./autoload_configs/enum.conf.xml
Use 'i' to install the temporary ./autoload_configs/enum.conf.xml
Use 'm' to merge the temporary and installed versions
Use 'v' to view the diff results again

Default is to leave the temporary file to deal with by hand

How should I deal with this? [Leave it for later] i

===> ./autoload_configs/enum.conf.xml installed successfully

.....