Script Index


/var/lib/sorcery/modules/libresurrect

<http://www.sourcemage.org>

Globals

TBD

Synopsis

Functions for dealing with resurrecting a spell


function can_resurrect()

Parameters:

Description

determines if a particular version of a spell can be resurrected


function resurrect_spell()

Parameters:

Description

High level overview: ensure theres a cache tarball unpack the tarball somewhere if the spell is installed backup everything split the files into three categories: state data, config files, regular files this can be roughly viewed as (its slightly more complicated) state data is data owned by sorcery (/var/state) config files are defined in the /var/lib/sorcery/configs file things not in the above categories are regular files copy regular files onto the system copy config files carefully (dont trample on user changes) if the file does not exist, just copy the new one elif the file exists and is identical to the new one, do nothing else the file exists and differs from the new one then if it is owned by the old spell with a valid md5 replace the file elif it is owned by the old spell with an invalid md5 (admin changed it) ask if the user wants to change it else the file might be owned by another spell, or might be an alien ask if the user wants to change it if the spell was installed remove regular files unique to the old spell remove unchanged config files ask about changed config files update state data call it a day FIXME: some of the informative message calls might work better as debug messages


function real_install_config_file()

Parameters:


function internal_install_config_file()

Parameters:


function real_handle_changed_config()

Parameters:

Description

Present the user with the following menu (0) trash $to and install over it (1) backup $to to $to.$savetime, install the new file in its place (2) leave $to in its place, copy the new file to $to.$savetime (3) do nothing (4) see a diff between $to and the new file choice 2 is currently the default, someday there will be a menu to choose what the default will be