project:kernel-autobuild:configuration:parser
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
project:kernel-autobuild:configuration:parser [2015/09/13 14:28] – ZHTyCviVItsoERv 146.185.234.48 | project:kernel-autobuild:configuration:parser [2016/03/15 00:13] (current) – old revision restored 91.89.129.106 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | http://lesbianshavingwildsexonwebcam.cf/#3913 lesbians having wild sex on webcam, | + | ====== parsecfg: configuration & command line parser (as of 0.8.1) ====== |
+ | |||
+ | ===== preface | ||
+ | |||
+ | Especially in this document, the term **configuration** refers | ||
+ | to the control of the process which is implemented by | ||
+ | kernel-autobuild. Not to the kernel configuration or anything else. | ||
+ | |||
+ | ===== outline ===== | ||
+ | |||
+ | There are mainly 3 sources of configuration input: | ||
+ | |||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * '' | ||
+ | * ''/ | ||
+ | * '' | ||
+ | * '' | ||
+ | * command line parameters which are described in [[project: | ||
+ | |||
+ | The '' | ||
+ | * a general section and | ||
+ | * template sections providing sets of options. | ||
+ | |||
+ | As usual with *nix software, the files in /etc precede the ones inside the | ||
+ | user's home directory ('' | ||
+ | which precede the command line options which in turn means | ||
+ | the settings override each other the other way round. | ||
+ | |||
+ | As far as kernel-autobuild is concerned, the '' | ||
+ | The use of '' | ||
+ | |||
+ | And last but not least the settings from a template section inside an '' | ||
+ | override the settings from the general section. | ||
+ | |||
+ | None of these file are mandatory neither are any command line options. | ||
+ | |||
+ | ===== sequence ===== | ||
+ | |||
+ | In detail settings are recognized in the following order: | ||
+ | |||
+ | * / | ||
+ | * / | ||
+ | * general options | ||
+ | * template options | ||
+ | * ~/ | ||
+ | * ~/ | ||
+ | * general options | ||
+ | * template options | ||
+ | * ./ | ||
+ | * ./ | ||
+ | * general options | ||
+ | * template options | ||
+ | * command line options | ||
+ | |||
+ | ===== implemenation ===== | ||
+ | |||
+ | ==== pitfall ==== | ||
+ | |||
+ | There is an implementation pitfall. One can't process the template | ||
+ | options at the time of reading the configuration file because the | ||
+ | command line hasn't been processed yet. So you don't know about the | ||
+ | selected template yet. The other way round doesn' | ||
+ | |||
+ | ==== how parsecfg puts things in order ==== | ||
+ | |||
+ | First there is a class of structures used: | ||
+ | |||
+ | < | ||
+ | | ||
+ | | | ||
+ | *-- general | ||
+ | *-- templates | ||
+ | | | ||
+ | *-- template A | ||
+ | *-- template B | ||
+ | ... | ||
+ | </ | ||
+ | |||
+ | Parsecfg reads all the configuration files at once, storing | ||
+ | the data in one structure per file. | ||
+ | |||
+ | Then it copies the contents of each structure in turn to | ||
+ | a master structure and by doing so it calculates the overriding | ||
+ | by just overwriting the values. There is an exception to options | ||
+ | which are allowed to be called multiple times: those values | ||
+ | are not overwritten but added to a list. | ||
+ | |||
+ | After that it processes the command line parameters storing all of them | ||
+ | in some extra structure in the general subtree. | ||
+ | |||
+ | Next step is to look if a "'' | ||
+ | If so inside the master structure the data from the corresponding | ||
+ | template section is written to the general section. So template data supersedes | ||
+ | general data. | ||
+ | |||
+ | Last step is to overwrite the master structure with data from the | ||
+ | command line structure. This is how in the end the command line " | ||
+ | |||
+ | ===== the xml format ===== | ||
+ | |||
+ | <file xml kernel-autobuild.xml> | ||
+ | <?xml version=" | ||
+ | <!-- Stand: Fri Mar 16 13:36:58 CET 2012 --> | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | <opt name=" | ||
+ | <opt name=" | ||
+ | <opt name=" | ||
+ | <opt name=" | ||
+ | <opt name=" | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | <opt name=" | ||
+ | </ | ||
+ | < | ||
+ | <opt name=" | ||
+ | <opt name=" | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ==== some simple conversion helper ==== | ||
+ | |||
+ | <file sh conf2xml> | ||
+ | #!/ | ||
+ | ( | ||
+ | cat << ' | ||
+ | < | ||
+ | < | ||
+ | < | ||
+ | . | ||
+ | awk ' | ||
+ | /^#/ { print " | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | ' | ||
+ | cat << ' | ||
+ | </ | ||
+ | < | ||
+ | < | ||
+ | <opt name=" | ||
+ | </ | ||
+ | < | ||
+ | <opt name=" | ||
+ | <opt name=" | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | </ | ||
+ | . | ||
+ | ) < kernel-autobuild.conf > kernel-autobuild.xml | ||
+ | |||
+ | </ |
project/kernel-autobuild/configuration/parser.1442147312.txt.gz · Last modified: 2015/09/13 14:28 by 146.185.234.48