Cupt::System::Worker(3) system modifier for Cupt

METHODS

new

creates new Cupt::System::Worker object

Parameters:

config - reference to Cupt::Config

cache - reference to Cupt::Cache

set_desired_state

method, sets desired state of the system

Parameters:

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 package

Parameters:

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 installed

Parameters:

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 actions

Returns 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 indexes

Returns 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 name

Parameters:

snapshots - Cupt::System::Snapshots

name - name of the snapshot

remove_system_snapshot

method, removes the system snapshot, identified by name

Parameters:

snapshots - Cupt::System::Snapshots

name - a name of the snapshot

rename_system_snapshot

method, renames the system snapshot

Parameters:

snapshots - Cupt::System::Snapshots

previous_name - previous name of the snapshot

new_name - new name of the snapshot