Technical data
8. Documentation for Developers
If the elements generated by such a split should be in a numeric context (e.g. as indices) this
has to be specified when calling split. This is done by the additional attribute “numeric”.
Such a call looks as follows:
split (<String>, <Array>, <Separator>, numeric)
An example:
set bar="1.2.3.4"
split (bar, tmp_%, '.', numeric)
foreach i in tmp_%
do
warning "%i = $i"
done
the output looks like this:
Warning: TMP_1 = 1
Warning: TMP_2 = 2
Warning: TMP_3 = 3
Warning: TMP_4 = 4
Hint: If using the “numeric” variant mkfli4l will not check the generated string parts for
really being numeric! If you use such a non-numeric construct later in a numeric context (i.e.
in an addtion) mkfli4l will raise a fatal error. Example:
set bar="a.b.c.d"
split (bar, tmp_%, '.', numeric)
# Error: invalid number 'a'
set i=tmp_%[1]+1
A string constant passed to split in the first parameter is subject of variable substitution
(Page 300).
Adding Files to the Archives: add_to_opt
The function add_to_opt can add additional files to the Opt- or RootFS-Archives. All files
under opt/ or from the configuration directory may be chosen. There is no limitation to
only files from a specific package. If a file is found under opt/ as well as in the configuration
directory, add_to_opt will prefer the latter. The function add_to_opt is typically used if
complex logical rules decide if and what files have to be included in the archives.
The syntax looks like this:
add_to_opt <File> [<Flags>]
Flags are optional. The defaults from table 8.2 are used if no flags are given.
See an example from the package “sshd”:
308










