LibPkg
|
A class for installing, removing and purging packages. More...
#include <commit.h>
Classes | |
struct | progress |
A structure for monitoring the download progress of one source. More... | |
Public Types | |
enum | state_type { state_paths, state_pre_download, state_download, state_unpack, state_configure, state_purge, state_update_sysvars, state_update_sprites, state_update_boot_options, state_boot_files, state_run_files, state_add_files_to_apps, state_done, state_fail } |
typedef unsigned long long | size_type |
A type for representing byte counts. More... | |
Public Member Functions | |
commit (pkgbase &pb, const std::set< string > &packages) | |
Construct commit operation. More... | |
virtual | ~commit () |
Destroy commit operation. More... | |
state_type | state () const |
Get current state of the commit operation. More... | |
size_type | files_done () const |
Get number of files processed. More... | |
size_type | files_total () const |
Get total number of files to process. More... | |
size_type | bytes_done () const |
Get number of bytes processed. More... | |
size_type | bytes_total () const |
Get total number of bytes to process. More... | |
string | message () const |
Get error message. More... | |
const std::set< string > & | files_that_conflict () const |
Get the set of destination pathnames that conflict with files already on the system. More... | |
void | log_to (log *use_log) |
Set the log to add to. More... | |
log * | warnings () const |
Return warnings log. More... | |
log * | detach_warnings () |
Detach warnings log. More... | |
![]() | |
thread () | |
Construct thread. More... | |
virtual | ~thread () |
Destroy thread. More... | |
Static Public Attributes | |
static const size_type | npos =static_cast<size_type>(-1) |
A null value for use in place of a byte count. More... | |
Protected Member Functions | |
virtual void | poll () |
Poll this thread. More... | |
Additional Inherited Members | |
![]() | |
static void | poll_all () |
Poll all threads. More... | |
A class for installing, removing and purging packages.
typedef unsigned long long pkg::commit::size_type |
A type for representing byte counts.
pkg::commit::commit | ( | pkgbase & | pb, |
const std::set< string > & | packages | ||
) |
Construct commit operation.
pb | the package database |
packages | the set of packages to process |
References pkg::status_table::clear(), pkg::status_table::commit(), pkg::pkgbase::curstat(), pkg::status_table::insert(), pkg::pkgbase::prevstat(), and pkg::pkgbase::selstat().
|
virtual |
Destroy commit operation.
|
inline |
Get current state of the commit operation.
|
inline |
Get number of files processed.
|
inline |
Get total number of files to process.
|
inline |
Get number of bytes processed.
|
inline |
Get total number of bytes to process.
|
inline |
Get error message.
When state()==state_fail, this function returns a human-readable description of what went wrong.
|
inline |
Get the set of destination pathnames that conflict with files already on the system.
When state()==state_fail, this function returns a list of files that must be deleted before the given set of packages can be processed.
void pkg::commit::log_to | ( | log * | use_log | ) |
Set the log to add to.
use_log | log to use or 0 to stop logging |
References pkg::LOG_INFO_START_COMMIT, and pkg::log::message().
|
inline |
Return warnings log.
|
inline |
Detach warnings log.
Detach the warnings log so it doesn't get destroyed with the commit object. It is then the responsibility of the object that detached the log to delete it.
|
protectedvirtual |
Poll this thread.
This function will be called repeatedly until the thread ceases to exist. The amount of work done per invokation should be kept small, in order that multithreading (within the application) and multitasking (across RISC OS as a whole) operate smoothly.
Reimplemented from pkg::thread.
References pkg::boot_options_file::add(), pkg::component::add_to_apps, pkg::path_table::alter(), pkg::boot_drive_relative(), pkg::unpack::bytes_done(), pkg::unpack::bytes_total(), pkg::pkgbase::cache_pathname(), pkg::boot_options_file::commit(), pkg::status_table::commit(), pkg::path_table::commit(), pkg::pkgbase::component_update_pathname(), pkg::config_req(), pkg::pkgbase::control(), pkg::pkgbase::curstat(), pkg::control::end(), pkg::unpack::files_done(), pkg::unpack::files_that_conflict(), pkg::unpack::files_total(), pkg::control::find(), pkg::component::flag(), pkg::status_table::insert(), pkg::LOG_ERROR_CACHE_INSERT, pkg::LOG_ERROR_PACKAGE_DOWNLOAD_FAILED, pkg::LOG_ERROR_PATHS_COMMIT, pkg::LOG_ERROR_PATHS_ROLLBACK, pkg::LOG_ERROR_UNPACK_FAILED, pkg::LOG_INFO_ADDING, pkg::LOG_INFO_ADDING_TO_APPS, pkg::LOG_INFO_BOOT_OPTIONS_UPDATED, pkg::LOG_INFO_BOOTING, pkg::LOG_INFO_BOOTING_FILES, pkg::LOG_INFO_CACHE_USED, pkg::LOG_INFO_COMMIT_DONE, pkg::LOG_INFO_DOWNLOADED_PACKAGE, pkg::LOG_INFO_DOWNLOADING_PACKAGE, pkg::LOG_INFO_END_PATHS, pkg::LOG_INFO_INSTALLED, pkg::LOG_INFO_PATH_CHANGE, pkg::LOG_INFO_PREPROCESS_PACKAGE, pkg::LOG_INFO_PURGED, pkg::LOG_INFO_REMOVE_PATH_OPTS, pkg::LOG_INFO_RUNNING, pkg::LOG_INFO_RUNNING_FILES, pkg::LOG_INFO_SPRITES_UPDATED, pkg::LOG_INFO_START_PATHS, pkg::LOG_INFO_STATE_UPDATE, pkg::LOG_INFO_SYSVARS_UPDATED, pkg::LOG_INFO_UNPACKED, pkg::LOG_INFO_UNPACKING, pkg::LOG_INFO_UPDATING_BOOT_OPTIONS, pkg::LOG_INFO_UPDATING_SPRITES, pkg::LOG_INFO_UPDATING_SYSVARS, pkg::unpack::log_to(), pkg::LOG_WARNING_ADDING_TO_APPS_FAILED, pkg::LOG_WARNING_BOOT_OPTIONS_FAILED, pkg::LOG_WARNING_BOOTING_FAILED, pkg::LOG_WARNING_COMPONENT_NOT_INSTALLED, pkg::LOG_WARNING_COMPONENT_UPDATE_DONE_FAILED, pkg::LOG_WARNING_REMOVE_COMPONENT, pkg::LOG_WARNING_RUNNING_FAILED, pkg::component::look_at, pkg::download::message(), pkg::log::message(), pkg::unpack::message(), pkg::component::movable, pkg::component::name(), npos, pkg::object_type(), pkg::os::OS_CLI(), pkg::parse_component_list(), pkg::component::path(), pkg::pkgbase::paths(), pkg::purge_req(), pkg::boot_options_file::remove(), pkg::remove_req(), pkg::path_table::rollback(), pkg::component::run, pkg::pkgbase::selstat(), pkg::download::state(), pkg::status::state(), pkg::unpack::state(), state_add_files_to_apps, state_boot_files, state_configure, pkg::download::state_done, state_done, pkg::unpack::state_done, pkg::download::state_download, state_download, pkg::download::state_fail, state_fail, pkg::unpack::state_fail, pkg::status::state_installed, pkg::status::state_not_present, state_paths, state_pre_download, state_purge, pkg::status::state_removed, state_run_files, state_unpack, state_update_boot_options, state_update_sprites, state_update_sysvars, pkg::unpack_req(), pkg::update_sprite_pool(), pkg::update_sysvars(), pkg::pkgbase::verify_cached_file(), and pkg::status::version().
A null value for use in place of a byte count.
Referenced by poll().
Reference Manual | LibPkg | Version 0.6.1 (28 Jan 2015) |