Technical data

8. Documentation for Developers
RE:yes|no.
This is useful if a test is performed only once and is relatively easy. For more details see
the next chapter.
5. Default Setting: In this column, an optional default value for the variables can be defined
in the case that the variable is not specified in the configuration file.
Hint: At the moment this does not work for array variables. Additionally, the variable
can’t be optional (no “+” in front of the variable name).
Example:
OPT_TELNETD - - YESNO "no"
If OPT_TELNETD is missing in the config file, “no” will be assumed and written as a value
to rc.cfg.
The percent sign thingie is best decribed with an example. Let’s assume check/base.txt
amongst others has the following content:
NET_DRV_N - - NUMERIC
NET_DRV_% - NET_DRV_N NONE
NET_DRV_%_OPTION - NET_DRV_N NONE
This means that depending on the value of NET_DRV_N the variables NET_DRV_N, NET_DRV_1_-
OPTION, NET_DRV_2_OPTION, NET_DRV_3_OPTION, a.s.o. will be checked.
8.3.6. Own Definitions for Checking the Configuration Variables
Introduction of Regular Expressions
In version 2.0 only the above mentioned value ranges for variable checks existed: NONE, NOTEMPTY,
NUMERIC, IPADDR, YESNO, NOBLANK, DIALMODE. Checking was hard-coded to mkfli4l, not expand-
able and restricted to essential “data types” which could be evaluated with reasonable efforts.
As of version 2.1 this checking has been reimplemented. The aim of the new implementation
is a more flexible testing of variables, that is also able to examine more complex expressions.
Therefore, regular expressions are used that can be stored in one or more separate files. This
on one hand makes it possible to examine variables that are not checked for the moment and
on the other hand, developers of optional packages can now define own terms in order to check
the configuration of their packages.
A description of regular expressions can be found via “man 7 regex” or i.e. here:
http://unixhelp.ed.ac.uk/CGI/man-cgi?regex+7.
Specification of Regular Expressions
Specification of regular expressions can be accomplished in two ways:
1. Package specific exp files check/<PACKAGE>.exp
This file can be found in the check directory and has the same name as the package
containing it, i.e. check/base.exp. It contains definitions for expressions that can
293