Skip to content

Component Retrieval Language

gridaphobe edited this page Sep 16, 2010 · 6 revisions

Component Retrieval Language

The Component Retrieval Language (CRL) specifies where to find the components, how to retrieve them, and where to store them on the local file system. It is a plain text language using a ! to indicate directives. The current required directives are:

Additional optional directives include:

The CRL file is split into sections, with each section corresponding to a repository. The order of the sections is irrelevant, however each section must begin with !TARGET. CRL supports comments prefaced with a #. The syntax for CRL directives is simply DIRECTIVE '=' VALUE The end of a value is indicated by the ! preceding the next directive. The argument may be enclosed in quotes (" or '), in which case the argument will be taken literally and no variable substitution will occur (not yet implemented). CRL ignores whitespace within a line and empty lines, so both may be used to add clarity to the file.

!CRL_VERSION

!CRL_VERSION indicates the current version of CRL used. Currently that is 1.0 so the line should be !CRL_VERSION = 1.0. This must be the first non-comment line of each CRL file.

!TARGET

!TARGET must be the first directive for each section. It will specify the directory, in which the components for the current repository will be placed. !TARGET may contain predefined constants i.e. $ROOT, which could represent the root directory for all of the components.

!TYPE

!TYPE specifies the tool used to checkout the components. Currently, cvs, svn, git, http, https, ftp, darcs, and hg (mercurial) are supported.

!URL

!URL specifies the location of the repository for anonymous checkout. !URL may contain variables $1, $2, etc, which will correspond to the directories in the path given by !CHECKOUT. For example, if you have !URL = http://svn.foo.com/$2/trunk !CHECKOUT = foo/bar !URL will be interpreted as http://svn.foo.com/bar/trunk.

!CHECKOUT

!CHECKOUT specifies the components to checkout from the repository. !CHECKOUT can contain a path through multiple directories, in which case they must be separated by a /. If there are multiple components to be checked out from a single repository, they should be separated by a newline. Any trailing whitespace or comments will be ignored.

!DEFINE

!DEFINE is an optional directive that will contain any definitions i.e. $ROOT. These definitions will be preceded by !DEFINE, and then follow the syntax for the directives. Definitions may only be defined once.

!NAME

!NAME specifies an alternate name for the component to be checked out. That means that if you have !TARGET = foo !CHECKOUT = bar !NAME = foobar the resulting directory tree will be foo/foobar.

!AUTHORIZATION_URL

!AUTHORIZATION_URL will specify a different location for an authenticated checkout. If both !AUTHORIZATION_URL and !URL are defined, !AUTHORIZATION_URL will take precedence. !AUTHORIZATION_URL can be abbreviated as !AUTH_URL.

!ANONYMOUS_USER and !ANONYMOUS_PASSWORD

!ANONYMOUS_USER and !ANONYMOUS_PASSWORD will specify the login credentials for an anonymous cvs checkout from the repository. They can be abbreviated as !ANON_USER and !ANON_PASS.

!REPOSITORY_PATH

!REPOSITORY_PATH will specify the location of the item to be checked out within a repository. It can consist of a file path, or $1 or $2, and will essentially serve as a prefix to the checkout path when the script is looking for the checkout item. !REPOSITORY_PATH can be abbreviated as !REPO_PATH.