Types
Generates a release upgrade file relup containing instructions for upgrading from or downgrading to one or more previous releases. The instructions are used by release_handler when installing a new version of a release in runtime.
By default, relup file is located in the current working directory. If option {outdir,Dir} is specified, the relup file is located in Dir instead.
The release resource file Name.rel is compared with all release resource files Name2.rel, specified in UpFrom and DownTo. For each such pair, the following is deducted:
-
Which applications to be deleted, that is, applications listed in Name.rel but not in Name2.rel
-
Which applications to be added, that is, applications listed in Name2.rel but not in Name.rel
-
Which applications to be upgraded/downgraded, that is, applications listed in both Name.rel and Name2.rel but with different versions
-
If the emulator needs to be restarted after upgrading or downgrading, that is, if the ERTS version differs between Name.rel and Name2.rel
Instructions for this are added to the relup file in the above order. Instructions for upgrading or downgrading between application versions are fetched from the relevant application upgrade files App.appup, sorted in the same order as when generating a boot script, see make_script/1,2. High-level instructions are translated into low-level instructions and the result is printed to the relup file.
The optional Descr parameter is included "as is" in the relup file, see relup(4). Defaults to the empty list.
All the files are searched for in the code path. It is assumed that the .app and .appup files for an application are located in the same directory.
If option {path,[Dir]} is specified, this path is appended to the current path. Wildcard * is expanded to all matching directories, for example, lib/*/ebin.
If option restart_emulator is specified, a low-level instruction to restart the emulator is appended to the relup file. This ensures that a complete reboot of the system is done when the system is upgraded or downgraded.
If an upgrade includes a change from an emulator earlier than OTP R15 to OTP R15 or later, the warning pre_R15_emulator_upgrade is issued. For more information about this, see Design Principles in System Documentation.
By default, errors and warnings are printed to tty and the function returns ok or error. If option silent is specified, the function instead either returns {ok,Relup,Module,Warnings}, where Relup is the release upgrade file, or {error,Module,Error}. Warnings and errors can be converted to strings by calling Module:format_warning(Warnings) or Module:format_error(Error).
If option noexec is specified, the function returns the same values as for silent but no relup file is created.
If option warnings_as_errors is specified, warnings are treated as errors.