MX-Tools

MX-Tools

What is Marine?

Marine is a command line tool to create Mozilla application update packages (.mar files). It is suitable both for automated build process and for interactive use. It's a part of MX-Tools package.

Features

Marine is meant to be used to create an update package based on a directory tree to be included in the package and optionally a base directory with an older version of the application to create an incremental update package.

Usage

The general command line syntax:

marine [options] sourcedir update.mar

The command must be run in the root of the directory hierarchy to be included in the installation package. The names of the subdirectories (if any) will be a part of each file path inside the package. The command line arguments are:

sourcedir
The directory containing the tree to be included in the update package.
update.mar
The file name of the output update package. If the file exists it will be overwritten.

Additionally, the following options may be specified:

-b basedir
The base directory to compare the sourcedir to. If this option is specified the created package will contain partial (incremental) update. If this option is omitted it is equivalent to the base directory being empty, that means a full update package will be created.
-w workdir
The temporary directory to be used to store intermediate files. If this option is specified it must be an existing empty directory. If the directory is not empty the process may fail or the resulting update package may contain garbage entries. If this option is omitted a temporary directory is created in the location typical for the operating system being used. In most cases there is no need to specify this option other than for debugging purposes.
-v
This option specifies that for each file is the sourcedir or basedir one line of text is written to the standard output indicating the way that file is being processed. The information lines can have one of the following forms:
= filename The file is skipped, because it is the same as in the basedir.
+ filename The file is added, because it does not exist in the basedir.
% filename The file is patched, because in the basedir it is slightly different from its counterpart in the sourcedir.
* filename The file is replaced, because in the basedir it is significantly different from its counterpart in the sourcedir.
- filename The file is removed, because it does not exist in the sourcedir.
Note: the operation performed on the file can be influenced by one or more of the command line options, as described below.
-a filelist
Specifies a text file containing the list of files to be forced to be added. Those files will be processed as if they did not exist in the basedir. If the value of filelist is "*" then this option applies to all files found in the sourcedir. This is not the same as not having basedir at all, because in this case, additionally, the files that exist in the basedir but not in the sourcedir will be removed. Note, "*" must be quoted or escaped properly when using a command shell that treats asterisk characters specially (like most UNIX shells).
-f filelist
Specifies a text file containing the list of files to be forced to be replaced rather than patched. This only applies to the files that exist both in the basedir and in the sourcedir and are different. If the value of filelist is "*" then this option applies to all files found in the sourcedir. Note, "*" must be quoted or escaped properly when using a command shell that treats asterisk characters specially (like most UNIX shells).
-r filelist
Specifies a text file containing the list of files to be forced to be removed. This means a remove instruction will be added to the update manifest for the files that exist neither in the basedir nor in the sourcedir. This is useful in case some files are created by the application at runtime and they should be removed upon update. If the list contains some files that exist either in the basedir or in the sourcedir those entries will be ignored.
-c
Use conditional instructions for extensions and search plugins, just like the Mozilla update scripts do. Normally this option should be specified if the application contains or may contain extensions or search plugins.

Description

The command examines the contents of the source and the base directories, creates necessary binary patch files using mbsdiff (whenever those can be compressed by bzip2 to a smaller size than the corresponding complete files), generates update.manifest file containing the instructions for the updater, and puts everything into the specified .mar file.

Examples

Create a simple full update package:

marine ./source-dir full-update.mar

Create a full update package for an application that contains extensions or search plugins:

marine -c ./source-dir full-update.mar

Create a simple incremental update package:

marine -b ./old-version-dir ./new-version-dir update.mar

Create an incremental update package and force full update of the files listed in filelist.txt:

marine -a filelist.txt -b ./old-version-dir ./new-version-dir update.mar

Create an incremental update package and force full update of all changed files:

marine -a "*" -b ./old-version-dir ./new-version-dir update.mar

Dependencies

Perl, bzip2, mbsdiff, mar.

License, Download, Feedback

As mentioned in the beginning of this page, Marine is a part of MX-Tools, so see there.