Command cdl_package -- Define a package, a component that can be distributed
Synopsis
cdl_package <name> {
…
}
Description
A package is a unit of distribution. It is also a configuration option
in that users can choose whether or not a particular package is loaded
into the configuration, and which version of that package should be
loaded. It is also a component in that it can contain additional
components and options in a hierarchy.
The top-level CDL script for a package should begin with a cdl_package
command. This can contain most of the properties that can be used in a
cdl_option command, and a number of additional ones which apply to a
package as a whole. It is also possible to include cdl_component,
cdl_interface and cdl_option commands in the body of a package.
However all configuration entities that occur at the top level of the
script containing the cdl_package command are automatically placed
below that package in the configuration hierarchy, so putting them
inside the body has no effect.
The following properties cannot be used in the body of a cdl_package
command:
flavor
Packages always have the flavor booldata.
default_value
The value of a package is its version number. This is specified at the
time the package is loaded into the configuration, and cannot be
calculated afterwards. Typically the most recent version of the
package will be loaded.
legal_values
The legal values list for a given package is determined by which
versions of that package are installed in the component repository,
and cannot be further constrained in the CDL scripts.
calculated
The value of a package is always selected at the time that it is
loaded into the configuration, and cannot be re-calculated afterwards.
script
This would be redundant since the CDL script containing the
cdl_package command acts as that package's script.
cdl_package is implemented as a Tcl command that takes two
arguments, a name and a body. The name must be a valid C preprocessor
identifier: a sequence of upper or lower case letters, digits or
underscores, starting with a non-digit character; identifiers
beginning with an underscore should normally be avoided because they
may clash with system packages or with identifiers reserved for use by
the compiler. Packages should always have unique names within a given
component repository. For a recommended naming convention see the Section called Package Contents and Layout in Chapter 2.
The second argument to cdl_package is a body of properties and other
commands, typically surrounded by braces so that the Tcl interpreter
treats it as a single argument. This body will be processed by a
recursive invocation of the Tcl interpreter, extended with additional
commands for the various properties that are allowed inside a
cdl_package. The valid commands are: