Some functions called from SCPM library generate the "progress output" - the text which has to be shown in some YCP widget. These functions are called from agents's separate thread, so the progress output can be read from YCP client while the functions are still running. After the end of output is reached (this also means that threads exited), Read(.scpm.exit_status) must be read.
Functions generating output are curretnly Add, Copy, PrepareSwitch, Switch, Save, Enable (only from uninitialized state).
Check the development documentation in the autodocs/ directory.
Important:If you want to use SCPM, don't forget to call Execute(.scpm) at first and Write(.scpm, nil) at the end. These calls do necessary initialization work (creating and destroying SCPM object).
See the Todo.txt file for the list of possible future enhancements.
Path | Argument | Type | Result |
---|---|---|---|
.scpm.status | YCPMap | Map with description of SCPM status. The important keys are enabled, initialized, needs_reinit (if reinitialization is necessary) and needs_recover (recovary after crash is needed) | |
.scpm.profiles | YCPList | list with all available profiles | |
.scpm.profiles.current | YCPString | the name of the active profile | |
.scpm.profiles.description | YCPString | YCPString | the description of the profile given as argument; if no argument is given, active profile is used (also in following calls) |
.scpm.profiles.prestart | YCPString | YCPString | path to the prestart script of the given profile |
.scpm.profiles.poststart | YCPString | YCPString | path to the poststart script of the given profile |
.scpm.profiles.prestop | YCPString | YCPString | path to the prestop script of the given profile |
.scpm.profiles.poststop | YCPString | YCPString | path to the poststop script of the given profile |
.scpm.resources | YCPList | list contaning two list of available resource sets, predefined and individual (e.g. [ [ "default" ], [ "my_set" ] ] | |
.scpm.resources.current | YCPString | name of the current resource set | |
.scpm.exit_status | YCPBoolean | true if function called in thread finished successfully |
Path | Argument | Result |
---|---|---|
.scpm | YCPValue | calls a destructor of the SCPM object (as argument use anything) |
.scpm.status.enabled | YCPBoolean | enables/disables SCPM |
.scpm.resources.current | YCPString | changes the active resource set to the given one |
.scpm.profiles.description | YCPString | sets the new description of the given profile; if nil argument is given, active profile is used (also in following calls) |
.scpm.profiles.prestart | YCPString | sets the new prestart script of the given profile |
.scpm.profiles.poststart | YCPString | sets the new poststart script of the given profile |
.scpm.profiles.prestop | YCPString | sets the new prestop script of the given profile |
.scpm.profiles.poststop | YCPString | sets the new poststop script of the given profile |
Path | 1st argument | 2nd argument | Result |
---|---|---|---|
.scpm | YCPString | calls a constructor of the SCPM object; argument is path to the temporary directory, where outfile, hashfile, changesfile and tmpfile are created | |
.switch.prepare | YCPString | prepares switch to the profile given as argument; dumps switch_info_t struct to tmpfile | |
.switch | YCPMap | switchs to the selected profile; argument is switch_info_t struct | |
.save | Saves modified resources of the profile | ||
.enable.first | enables SCPM for the first time - this is different from Write(.scpm.status.enabled) by generating output | ||
.profiles.add | YCPString | adds a new profile | |
.profiles.delete | YCPString | deletes a profile given as parameter | |
.profiles.copy | YCPString | YCPString | copies a profile (given as 1st argument) to the new profile (2nd argument) |
.profiles.rename | YCPString | YCPString | renames a profile |
.profiles.changes | YCPString | YCPString | checks the changes of the selected resource (1st argument is ist name, the 2nd its type) and dumps the output to changesfile |
.resources.rebuild | rebuilds the resources database | ||
.resources.delete | YCPString | [not implemented yet] | |
.resources.copy | YCPString | YCPString | [not implemented yet] |
The calls from switch, switch.prepare, add, copy and enable.first paths generate output to outfile so they are started in separate thread.
Jiri Suchomel <jsuchome@suse.cz>