5.3. Adding functions

any system checks for each of configuration words, whether the library file with the same name is present.

For example, if output of auserdd has the word num, and file any/lib/num.sh exists, the given file num.sh will be loaded into environment of build engine.

That means you may add functions and redefine the behaviour of standard interfaces with configuring and command line.

For example, we want to provide downloading of package sources from a server. For that purpose we want to change the behaviour of src_fetch(3) function from map sequence. We place code with our downloading function, named src_fetch, into file any/lib/newfetch.sh. The following is added to config:

rdd_prf_id = any, amd64, linux, gcc, newfetch
Now any/lib/newfetch.sh file will be included as the library of any. That information is seen at the beginning of every build log, where list of loaded modules is shown. New code has higher priority and will replace the original variant of src_fetch.

The described method allows to add new functions, change the behaviour of old ones, add build interfaces to API, which may be called inside anybuilds.