Technical data
8. Documentation for Developers
Expansion of Existing Regular Expressions
If an optional package adds an additional value for a variable which will be examined by a
regular expression, then the regular expression has to be expanded. This is done simply by
defining the new possible values by a regular expression (as described above) and complement
the existing regular expression in a separate check/<PACKAGE>.exp file. That an existing
expression is modified is indicated by a leading “+”. The new expression complements the
existing expression by appending the new value to the existing value(s) as an alternative. If
another expression makes use of the complemented expression, the supplement is also there.
The specified error message is simply appended to the end of the existing one.
Using the Ethernet driver as an example this could look like here:
• The base packages provides a lot of Ethernet drivers and checks the variable NET_DRV_x
using the regular expression NET_DRV, which is defined as follows:
NET_DRV = '3c503|3c505|3c507|...'
: 'invalid ethernet driver, please choose one'
' of the drivers in config/base.txt'
• The package “pcmcia” provides additional device drivers, and hence has to complement
NET_DRV. This is done as follows:
PCMCIA_NET_DRV = 'pcnet_cs|xirc2ps_cs|3c574_cs|...' : ''
+NET_DRV = '(RE:PCMCIA_NET_DRV)' : ''
Now PCMCIA drivers can be chosen in addition.
Extend Regular Expressions in Relation to YESNO Variables
If you have extended NET_DRV with the PCMCIA drivers as shown above, but the package
“pcmcia” has been deactivated, you still could select a PCMCIA driver in config/base.txt
without an error message generated when creating the archives. To prevent this, you may
let the regular expression depend on a YESNO variable in the configuration. For this purpose,
the name of the variable that determines whether the expression is extended is added with
brackets immediately after the name of the expression. If the variable is active and has the
value “yes”, the term is extended, otherwise not.
PCMCIA_NET_DRV = 'pcnet_cs|xirc2ps_cs|3c574_cs|...' : ''
+NET_DRV(OPT_PCMCIA) = '(RE:PCMCIA_NET_DRV)' : ''
If specifying OPT_PCMCIA='no' and using i.e. the PCMCIA driver xirc2ps_cs in
config/base.txt, an error message will be generated during archive build.
Hint: This does not work if the variable is not set explicitely in the configuration file but
gets its value by a default setting in check/<PACKAGE>.txt. In this case the variable hence
has to be set explicitely and the default setting has to be avoided if necessary.
295










