METHODS
new
creates new Cupt::System::Worker objectParameters:
config - reference to Cupt::Config
cache - reference to Cupt::Cache
set_desired_state
method, sets desired state of the systemParameters:
desired_state - the desired state after the actions, hash reference:
{ I<package_name> => { 'version' => I<version>, 'manually_selected' => boolean 'reasons' => [ I<reason>... ] } }
where:
version - reference to Cupt::Cache::BinaryVersion
TODO: reason description
get_actions_preview
method, returns actions to be done to achieve desired state of the system (desired_state)Returns:
{ 'install' => I<packages>, 'remove' => I<packages>, 'purge' => I<packages>, 'upgrade' => I<packages>, 'downgrade' => I<packages>, 'configure' => I<packages>, 'deconfigure' => I<packages>, 'markauto' => [ $package_name ... ] 'unmarkauto' => [ $package_name ... ] }
where:
packages = [
{
'package_name' => $package_name,
'version' => version,
'reasons' => [ reason... ]
}...
]
version - reference to Cupt::Cache::BinaryVersion
get_download_sizes_preview
Parameters:ref_actions_preview - supply result of ``get_actions_preview'' here
Returns (total_bytes, need_bytes);
total_bytes - total byte count needed for action, need_bytes - byte count, needed to download, <= total_bytes
get_unpacked_sizes_preview
returns changes in unpacked sizes after whole operation for each packageParameters:
ref_actions_preview - supply result of ``get_actions_preview'' here
Returns: { $package_name => $size_change }
mark_as_automatically_installed
method, marks group of packages as automatically/manually installedParameters:
value - boolean value: true - mark as automatically installed, false - mark as manually installed
package_name... - array of of package names to mark
change_system
member function, performes planned actionsReturns true if successful, false otherwise
Parameters:
download_progress - reference to subclass of Cupt::Download::Progress
update_release_and_index_data
member function, performes update of APT/Cupt indexesReturns true if successful, false otherwise
Parameters:
download_progress - reference to subclass of Cupt::Download::Progress
clean_archives
method, cleans archives directory.Parameters:
sub_callback - reference to callback subroutine which will be called for each deletion with one argument - file path
leave_available - whether to leave .debs that are available from package indexes or not
save_system_snapshot
method, saves system snapthot under specified nameParameters:
snapshots - Cupt::System::Snapshots
name - name of the snapshot
remove_system_snapshot
method, removes the system snapshot, identified by nameParameters:
snapshots - Cupt::System::Snapshots
name - a name of the snapshot
rename_system_snapshot
method, renames the system snapshotParameters:
snapshots - Cupt::System::Snapshots
previous_name - previous name of the snapshot
new_name - new name of the snapshot