# CONFIGURE

The CONFIGURE script is sourced during a cast, after DETAILS and before DEPENDS and CONFLICTS. It is used to take care of more complex spells for which extra information must be gathered and stored. This can be needed when there are optional ./configure switches that don't require any extra spells, or for doing extra things in the BUILD script. The query can be made in the CONFIGURE and then the flags stored can be used in any of the spell scripts.

## Persistence

Sorcery provides a way to store and later re-store environment variables between different spell scripts. The environment variable you want to persist must be marked by function persistent_add:

persistent_add VAR BLAH SPELL_OPTION

This way you marked the three variables so that they will be persisted.

Moreover Sorcery gives you tools for querying user for information. The functions are provided for your convenience:

• config_query
• config_query_string
• config_query_list
• config_query_option
• config_query_multi (defined in config_query_multi.function file found in the root of some grimoires)

These functions do have three parameters:

• variable name
• question presented to the user
config_query RMRF "Perform rm -rf / ?" y
config_query_string NAME "What is your name ?" $USER config_query_list MTA "Which mta would you like to use ?" qmail sendmail postfix config_query_option SPELL_OPTION "Use X ?" y "--with-x" "--without-x" config_query_multi SOMETHING "What do you want?" all none something1 something2 config_query_option is a bit different, it does not overwrite content of $SPELL_OPTION, rather the result is appended to it. config_query_multi is different from config_query_list in that it makes available multiple options instead of just one.