[Ericsson AB]

reltool

MODULE

reltool

MODULE SUMMARY

Main API of the Reltool application

DESCRIPTION

This is an interface module for the Reltool application

Reltool is a release management tool. It analyses a given Erlang/OTP installation and determines various dependencies between applications. The graphical frontend depicts the dependencies and enables interactive customization of a target system. The backend provides a batch interface for generation of customized target systems.

The tool uses an installed Erlang/OTP system as input. root_dir is the root directory of the analysed system and it defaults to the system executing reltool. Applications may also be located outside root_dir. lib_dirs defines additional library directories where applications additional may reside and it defaults to the the directories listed by the operating system environment variable ERL_LIBS. See the module code for more info. Finally single modules and entire applications may be read from Escripts. The names of the Escripts are given in the configuration parameter escripts. By default, no Escripts are included.

Some configuration parameters control the behavior of Reltool on system (sys) level. Others provide control on application (app) level and yet others are on module (mod) level. Module level parameters overrides application level parameters and application level parameters overrides system level parameters.

The following top level options are supported:

config
This is the main option and it controls the configuration of reltool. It can either be a sys tuple or a name of a file containing a sys tuple.
trap_exit
This option controls the error handling behavior of reltool. By default the window processes traps exit, but this behavior can altered by setting trap_exit to false.
wx_debug
This option controls the debug level of wx. As its name indicates it is only useful for debugging. See wx:debug/1 for more info.

Besides the already mentioned source parameters root_dir, lib_dirs and escripts, the following system (sys) level options are supported:

erts
Erts specific configuration. See application level options below.
app
Application specific configuration. An application has a mandatory name and application level options that are described below.
mod_cond
This parameter controls the module inclusion policy. It defaults to all which means that if an application is included (either explicitly or implicitly) all modules in that application will be included. This implies that both modules that exists on the ebin directory of the application, as well as modules that are named in the app file will be included. If the parameter is set to ebin, both modules on the ebin directory and derived modules are included. If the parameter is set to app, both modules in the app file and derived modules are included. derived means that only modules that are used by other included modules are included. The mod_cond setting on system level is used as default for all applications.
incl_cond
This parameter controls the application inclusion policy. It defaults to derived which means that the applications that not have any explicit incl_cond setting, will only be included if any other (explicitly or implicitly included) application uses it. The value include implies that all applications that that not have any explicit incl_cond setting will be included. exclude implies that all applications that that not have any explicit incl_cond setting will be excluded.
boot_rel
A target system may have several releases but the one given as boot_rel will be used as default when the system is booting up.
rel
Release specific configuration. Each release maps to a rel, script and boot file. See the module systools for more info about the details. Each release has a name, a version and a set of applications with a few release specific parameters such as type and included applications.
app_file
This parameter controls the default handling of the app files when a target system is generated. It defaults to keep which means that app files are copied to the target system and their contents are kept as they are. strip means that a new app file is generated from the contents of the original app file where the non included modules are removed from the file. all does also imply that a new app file is generated from the contents of the original app file, with the difference that all included modules are added to the file. If the application does not have any app file a file will be created for all but not for keep and strip.
debug_info
The debug_info parameter controls whether the debug information in the beam file should be kept (keep) or stripped strip when the file is copied to the target system.
incl_erts_dirs
By default only the bin directory is copied to the target system for erts. This parameter controls if other directories should be copied. erts may optionally have an application directory containing erl and beam files for preloaded code. Which application directories that shall be copied are controlled with incl_app_dirs and excl_app_dirs.
excl_erts_dirs
This parameter controls which erts directories that not should be copied to the target system. In order to be copied, a directory must be included in incl_erts_dirs and NOT be included in excl_erts_dirs.
incl_app_dirs
By default only the application directories ebin and priv are copied to the target system. This parameter controls if other directories should be copied.
excl_app_dirs
This parameter controls which applications directories that not should be copied to the target system. In order to be copied, a directory must be included in incl_app_dirs and NOT be included in excl_app_dirs.

On application (app) level,the following options are supported:

vsn
The version of the application. In an installed system there may exist several versions of an application. The vsn parameter controls which version of the application that will be choosen. If it is omitted, the latest version will be choosen.
mod
Module specific configuration. A module has a mandatory name and module level options that are described below.
mod_cond
The value of this parameter overrides the parameter with the same name on system level.
incl_cond
The value of this parameter overrides the parameter with the same name on system level.
app_file
The value of this parameter overrides the parameter with the same name on system level.
debug_info
The value of this parameter overrides the parameter with the same name on system level.
incl_app_dirs
The value of this parameter overrides the parameter with the same name on system level.
excl_app_dirs
The value of this parameter overrides the parameter with the same name on system level.

On module (mod) level,the following options are supported:

incl_cond
This parameter controls whether the module is included or not. By default the mod_incl parameter on application and system level will be used to control whether the module is included or not. The value of incl_cond overrides the module inclusion policy. include implies that the module is included, while exclude implies that the module not is included. derived implies that the is included if any included uses the module.
debug_info
The value of this parameter overrides the parameter with the same name on application level.

DATA TYPES

options()        = [option()]
option()         = {config, config() | file()}
                 | {trap_exit, bool()}
                 | {wx_debug, term()} 
config()         = {sys, [sys()]}
sys()            = {root_dir, root_dir()}
                 | {lib_dirs, [lib_dir()]}
                 | {escripts, [escript()]}
                 | {erts, app()}
                 | {app, app_name(), [app()]}
                 | {mod_cond, mod_cond()} 
                 | {incl_cond, incl_cond()}
                 | {boot_rel, boot_rel()}
                 | {rel, rel_name(), rel_vsn(), [rel_app()]}
                 | {app_file, app_file()}
                 | {debug_info, debug_info()}
                 | {incl_erts_dirs, [incl_erts_dir()]}
                 | {excl_erts_dirs, [excl_erts_dir()]}
                 | {incl_app_dirs, [incl_app_dir()]}
                 | {excl_app_dirs, [excl_app_dir()]}
app()            = {vsn, app_vsn()}
                 | {mod, mod_name(), mod()}
                 | {mod_cond, mod_cond()}
                 | {incl_cond, incl_cond()}
                 | {debug_info, debug_info()}
                 | {app_file, app_file()}
                 | {incl_app_dirs, [incl_app_dir()]}
                 | {excl_app_dirs, [excl_app_dir()]}
mod()            = {vsn, app_vsn()}
                 | {incl_cond, incl_cond()}
                 | {debug_info, debug_info()}
rel_app()        = app_name()
                 | {app_name(), app_type()} 
                 | {app_name(), [incl_app()]}
                 | {app_name(), app_type(), [incl_app()]}
app_name()       = atom()
app_type()       = permanent | transient | temporary | load | none
app_vsn()        = string()
boot_rel()       = rel_name()
app_file()       = keep | strip | all
debug_info()     = keep | strip
dir()            = string()
escript()        = file()
escript_arg()    = string()
excl_app_dir()   = dir()
excl_erts_dir()  = dir()
file()           = string()
incl_app()       = app_name()
incl_app_dir()   = dir()
incl_cond()      = include | exclude | derived
incl_erts_dir()  = dir()
lib_dir()        = dir()
mod_cond()       = all | app | ebin | derived | none
mod_name()       = atom()
reason()         = string()
rel_file()       = term()
rel_name()       = string()
rel_vsn()        = string()
root_dir()       = dir()
script_file()    = term()
server()         = server_pid() | options()
server_pid()     = pid()
window_pid()     = pid()

EXPORTS

create_target(Server, TargetDir) -> ok | {error, Reason}

Types:

Server = server()
TargetDir = dir()
Reason = reason()

Create a target system. In order to be able to run the target system, it must be installed first.

get_config(Server) -> {ok, Config} | {error, Reason}

Types:

Server = server()
Config = config()
Reason = reason()

Get reltool configuration. Only configuration parameters with values that differs from their defaults are returned.

get_rel(Server, Relname) -> {ok, RelFile} | {error, Reason}

Types:

Server = server()
RelName = rel_name()
RelFile = rel_file()
Reason = reason()

Get contents of a release file. See rel(4) for more details.

get_script(Server, Relname) -> {ok, ScriptFile | {error, Reason}

Types:

Server = server()
RelName = rel_name()
ScriptFile = script_file()
Reason = reason()

Get contents of a boot script file. See script(4) for more details.

install(Server, TargetDir) -> ok | {error, Reason}

Types:

Server = server()
TargetDir = dir()
Reason = reason()

Install a created target system

start(Options) -> {ok, WindowPid} | {error, Reason}

Types:

Options = options()
WindowPid = window_pid()
Reason = reason()

Start a main window process with options

start_server(Options) -> {ok, ServerPid} | {error, Reason}

Types:

Options = options()
ServerPid = server_pid()
Reason = reason()

Start a server process with options. The server process identity can be given as argument to several other functions in the API.

stop(Pid) -> ok | {error, Reason}

Types:

Pid = server_pid() | window_pid()()
Reason = reason()

Stop a server or window process


reltool 0.2
Copyright © 1991-2009 Ericsson AB