Previous: Symbolic Tags, Up: Working With Arch

4.5 Multi-tree Projects and Configuration Management

You can define meta-projects which are combinations of individual projects that are separately tracked by arch. This allows you to divide a large project into smaller, more manageable pieces, each of which can develop independently of the others, and each of which can be a part of more than one meta-project.

This is accomplished by writing config specs, which define the contents of the meta-project and how they should be arranged in a source tree.

For example, arch itself is a meta-project. The source tree contains:


Each of those directories is the root of a project tree (contains a subdirectory named {arch}).

The topmost directory, dists also contains a subdirectory named configs. In that subdirectory are the meta-project configuration files. For example:

                 dists/configs/  # Tom's configuration files

Here are the contents of devo.arch:

          # Check out an arch distribution from the devo branches.
          # Latest revisions.

Each (non-blank, non-comment) line in that file has the format:

             LOCATION             CONTENTS

which means, to create the meta-project, get the revision indicated by CONTENTS and install it at LOCATION. The CONTENTS field can be a branch (meaning, get the latest revision of the latest version on that branch), a version (meaning get the latest revision in that version), or a revision name (meaning get that revision, exactly).

To check out an entire arch tree, I first check out dists from devo, then use build-config:

             % tla get dists--devo dists
             % cd dists
             % tla build-config

Once you have a meta-project tree, some other useful commands are:

          cat-config : output information about a multi-project config

One use of that command is to generate a list of sub-projects to which some other command can be iteratively applied:

             % tla cat-config CFGNAME | awk '{print $1}' | xargs ...

Additionally, the option --snap can be usefully applied to a configuration that names subproces by version rather than revision. It examines the project tree to see what revisions are actually installed at each of the LOCATIONs. Then it writes a new config which specify those REVISIONS precisely. This is useful, for example, for recording the specific revisions you are about to turn into a distribution.