Revision as of 08:59, 20 July 2006

Contents

Erlmerge

Introduction

Erlmerge is a tool for installing and maintaining Erlang applications. The basic idea - which is blatantly stolen from the Gentoo emerge command - is to make it possible to retrieve, compile and install Erlang code using one simple command: erlmerge.

When installing Erlmerge, an packet database will be created in the Erlang installation directory. Assuming Erlang is installed under /usr/local/lib/erlang, we will create a new directory: /usr/local/lib/erlang/erlmerge_DB when Erlmerge is installed. This directory will hold the packet database, the current list of known packets, the downloaded packet tar-balls and a Makefile include file.

A packet is simply an Erlang application, and the packet list contains the .app file contents of all the available packets. The .app file content has been extended a little bit to handle location information and dependencies to other applications. For example, the information for the esmb application looks as shown below.

To make an application Erlmerge capable it is important that its directory structure follows the way OTP applications are laid-out. Lots of code exists in the jungerl repository where it is hard to know what status the code is in. To make an easy transition, we have prepared jungerl to make it really easy to create new releases that are erlmerge capable. Look at the Makefiles of the esmb and fd_server for example of how to setup your Erlang (and C) application. Basically, what you need to do is to add a two new targets to your Makefile.

Don't forget to set a CVS tag on your application when producing a release. Hopefully, this would enhance the usefulness of jungerl even more.

Note: The use of Erlmerge could make it possible to start doing Erlang

releases in a completely new way. For example, the OTP team could
release just a minimal Erlang system, where most (all?) of the applications could
be installed aftewards, on demand. Bug fixes could be released per application, etc.

Installing Erlmerge

To install erlmerge the first time, download the latest erlmerge-X.Y_src.tar.gz
tar-ball from the
download directory.
Unpack it, compile and install it as shown below:

tar xvzf erlmerge-0.1_src.tar.gz

cd erlmerge-0.1

make

make install (as root if Erlang is installed as root)

This will install a shell script named erlmerge in parallel with your erl script.

Using Erlmerge

When you have installed the erlmerge command you can search among the applications currently available as in the example below:

In the example above, after the sync operation, we search for the esmb application which is available but not installed. To install this application we use the install operation. The -p (pretend) switch will perform a dry run without actually installing anything. It will however show us any possible dependencies which also will be installed.

The output from the -p switch produces a compact "array" of information. It tells you if the application is new, if it will be upgraded to a newer version or if it will be rebuilt due to changed dependencies.

If you want to remove the whole Erlmerge system, including all installed applications, you can use the suicide operation. This will cause the erlmerge_DB directory to be removed along with all applications installed by erlmerge. Finally, it will also remove the erlmerge script itself, restoring your Erlang installation to its original state.