LibPkg
|
The namespace used to hold the package management library. More...
Namespaces | |
os | |
swi | |
Classes | |
class | add_to_apps_options |
Class to configure the add to apps option section in the PreDeskop file. More... | |
class | all_check |
Class for packages that should run anywhere. More... | |
class | arm26_check |
Class for packages that need a 26 bit version of RISC OS. More... | |
class | arm_check |
Class for packages that need a 32Bit version of RISC OS. More... | |
class | auto_dir |
A class for automatically creating and deleting directories. More... | |
class | binary_control |
A class to represent the content of a RiscPkg binary control file. More... | |
class | binary_control_table |
A class for mapping package name and version to binary control record. More... | |
class | boot_options_file |
Base class to manipulate the RISC OS boot options files in Choices. More... | |
struct | case_insensitive_cmp |
Comparison that does not take into account the case of the string. More... | |
class | commit |
A class for installing, removing and purging packages. More... | |
class | component |
A class to represent a component of a package. More... | |
class | component_update |
A class for managing the updating of package components. More... | |
class | control |
A class to represent the content of a RiscPkg control file. More... | |
class | dependency |
A class to represent a package dependency. More... | |
class | dirstream |
A class for reading directories. More... | |
class | download |
A class for downloading a file from a URL. More... | |
class | env_check |
Base class for the environment checking classes. More... | |
class | env_checker |
Class to check environment and convert a string environment specification into a pkg_env There is only a single instance of this. More... | |
class | env_checker_ptr |
Class to help manage the single env_checker instance. More... | |
class | env_packages_table |
A class that filters the binary control table to create a list of the packages available in the current environment. More... | |
class | log |
Class to log actions that occur in LibPkg. More... | |
class | log_entry |
A class to represent one log entry. More... | |
struct | log_text_item |
class | look_at_options |
Class to configure the look at options file in the Desktop file. More... | |
class | md5 |
A class for producing MD5 message digests. More... | |
class | module_check |
Class for packages that need to OS to contain a specific module. More... | |
class | module_info |
Class to read the header details from a RISC OS Module. More... | |
class | path_table |
A class for mapping source paths to destination paths. More... | |
class | pkg_env |
A class to represent the enviroment a package is designed for. More... | |
class | pkgbase |
A class for representing the collection of package database tables. More... | |
class | run_options |
Class to configure the run options in the Desktop file. More... | |
class | source_table |
A class for holding a list of source URLs. More... | |
class | sprite_file |
An interface class to represent a sprite file. More... | |
class | status |
A class to represent the current or required status of a package. More... | |
class | status_table |
A class for mapping package name to package status. More... | |
class | swp_check |
Class for packages that use the SWP instruction that was discontinued in ARMv8? More... | |
class | table |
A base class to represent a data table. More... | |
class | thread |
A mixin class to represent a cooperative thread. More... | |
class | trigger |
class to represent a trigger action from a script More... | |
class | trigger_run |
Interface to execute a trigger. More... | |
class | triggers |
A class to manage the package triggers executed during the commiting of the packages. More... | |
class | unknown_check |
Class for environment checks not recognised by the current version. More... | |
class | unpack |
A class for unpacking and removing sets of packages. More... | |
class | unset_check |
Class for packages where the environment has not been set. More... | |
class | update |
A class for updating the package database. More... | |
class | uri |
A class to represent a uniform resource identifier. More... | |
class | version |
A class to represent a package version. More... | |
class | vfp_check |
Class for packages that need Vector Floating Point (VFP2) support. More... | |
class | zipfile |
An interface class to represent a zip file. More... | |
Functions | |
bool | operator< (const binary_control_table::key_type &lhs, const binary_control_table::key_type &rhs) |
Compare two binary control table keys. More... | |
void | parse_component_list (std::string::const_iterator first, std::string::const_iterator last, std::vector< component > *out) |
Parse component list. More... | |
std::ostream & | operator<< (std::ostream &out, const component &comp) |
Write component record to output stream. More... | |
std::istream & | operator>> (std::istream &in, component &comp) |
Read component record from input stream. More... | |
std::ostream & | operator<< (std::ostream &out, const control &ctrl) |
Write control file to output stream. More... | |
std::istream & | operator>> (std::istream &in, control &ctrl) |
Read control file from input stream. More... | |
void | parse_dependency_alt_list (string::const_iterator first, string::const_iterator last, std::vector< dependency > *out) |
Parse dependency alternatives list. More... | |
void | parse_dependency_list (string::const_iterator first, string::const_iterator last, std::vector< std::vector< dependency > > *out) |
Parse dependency list. More... | |
unsigned int | platform_features () |
Check platform features. More... | |
string | canonicalise (const string &pathname) |
Canonicalise pathname. More... | |
void | force_delete (const string &pathname) |
Delete file without regard for file attributes. More... | |
void | soft_delete (const string &pathname) |
Delete file without changing file attributes It is not an error if the file does not exist. More... | |
void | force_move (const string &src_pathname, const string &dst_pathname, bool overwrite=false) |
Move file without regard for file attributes. More... | |
void | copy_object (const string &src_pathname, const string &dst_pathname) |
Recursively copy object. More... | |
void | create_directory (const string &pathname) |
Create directory. More... | |
void | write_file_info (const string &pathname, unsigned int loadaddr, unsigned int execaddr, unsigned int attr) |
Write file information. More... | |
void | write_filetype (const string &pathname, unsigned int filetype) |
Write filetype. More... | |
unsigned int | object_type (const string &pathname) |
Get object type. More... | |
unsigned int | object_length (const string &pathname) |
Get object length. More... | |
std::string | boot_drive_relative (const string &pathname) |
Get version of pathname made relative the the boot drive. More... | |
char * | copystr (const char *str) |
Make a copy of a string if it's not null. More... | |
std::ostream & | operator<< (std::ostream &stream, const log &olog) |
bool | is_alias (const std::string &src_pathname) |
string | resolve_pathrefs (const path_table &table, const string &in) |
Resolve logical path references. More... | |
void | update_sprite_pool (pkgbase &pb) |
Update sprite pool. More... | |
bool | can_process (const version &standards_version) |
Test whether standards version can be processed by this library. More... | |
bool | operator== (const status &lhs, const status &rhs) |
Test whether two status records are equal. More... | |
bool | operator!= (const status &lhs, const status &rhs) |
Test whether two status records are unequal. More... | |
std::ostream & | operator<< (std::ostream &out, const std::pair< string, status > &pkgstat) |
Write package status record to output stream. More... | |
std::istream & | operator>> (std::istream &in, std::pair< string, status > &pkgstat) |
Read package status record from input stream. More... | |
bool | unpack_req (const status &curstat, const status &selstat) |
Determine whether a package should be unpacked. More... | |
bool | remove_req (const status &curstat, const status &selstat) |
Determine whether a package should be removed. More... | |
bool | config_req (const status &curstat, const status &selstat) |
Determine whether a package should be configured. More... | |
bool | purge_req (const status &curstat, const status &selstat) |
Determine whether a package should be purged. More... | |
void | update_sysvars (pkgbase &pb) |
Update system variable definitions. More... | |
const std::string | post_remove_dirname ("PRTriggers") |
The temporary directory for post remove triggers. More... | |
std::string | dst_to_post_remove (const std::string &dst_pathname) |
Convert destination pathname to pathname for post remove triggers. More... | |
bool | operator== (const version &lhs, const version &rhs) |
Test whether two versions are equal. More... | |
bool | operator!= (const version &lhs, const version &rhs) |
Test whether two versions are unequal. More... | |
bool | operator< (const version &lhs, const version &rhs) |
Test whether one version is less than another. More... | |
bool | operator>= (const version &lhs, const version &rhs) |
Test whether one version is greater than or equal to another. More... | |
bool | operator<= (const version &lhs, const version &rhs) |
Test whether one version is less than or equal to another. More... | |
bool | operator> (const version &lhs, const version &rhs) |
Test whether one version is greater than another. More... | |
Variables | |
const char * | ComponentFlagNames [] |
const char | ENV_MODULE_SEP = '\x01' |
const char * | error_text [] |
const char * | warning_text [] |
const char * | trace_text [] |
const char * | info_text [] |
struct pkg::log_text_item | log_text [] |
The namespace used to hold the package management library.
enum pkg::env_check_type |
enum pkg::LogCode |
An enumeration of all the items that can be logged.
bool pkg::operator< | ( | const binary_control_table::key_type & | lhs, |
const binary_control_table::key_type & | rhs | ||
) |
Compare two binary control table keys.
lhs | the left hand side |
rhs | the right hand side |
References pkg::binary_control_table::key_type::pkgenv, pkg::binary_control_table::key_type::pkgname, and pkg::binary_control_table::key_type::pkgvrsn.
Referenced by pkg::binary_control_table::end(), and pkg::version::package_version().
void pkg::parse_component_list | ( | std::string::const_iterator | first, |
std::string::const_iterator | last, | ||
std::vector< component > * | out | ||
) |
Parse component list.
first | the beginning of the sequence |
last | the end of the sequence |
out | a vector to which the coponents are added |
Referenced by pkg::commit::poll(), and pkg::trigger::trigger().
std::ostream & pkg::operator<< | ( | std::ostream & | out, |
const component & | comp | ||
) |
Write component record to output stream.
out | the output stream |
comp | the component record |
References pkg::component::path().
Referenced by pkg::log::entry().
std::istream & pkg::operator>> | ( | std::istream & | in, |
component & | comp | ||
) |
Read component record from input stream.
in | the input stream |
comp | the component record |
References pkg::component::component(), and pkg::component::path().
std::ostream & pkg::operator<< | ( | std::ostream & | out, |
const control & | ctrl | ||
) |
Write control file to output stream.
out | the output stream |
ctrl | the control file |
References pkg::control::begin(), and pkg::control::end().
std::istream & pkg::operator>> | ( | std::istream & | in, |
control & | ctrl | ||
) |
Read control file from input stream.
in | the input stream |
ctrl | the control file |
References pkg::control::end(), and pkg::control::find().
void pkg::parse_dependency_alt_list | ( | string::const_iterator | first, |
string::const_iterator | last, | ||
std::vector< dependency > * | out | ||
) |
Parse dependency alternatives list.
first | the beginning of the sequence |
last | the end of the sequence |
out | a vector to which the list is written |
Referenced by parse_dependency_list().
void pkg::parse_dependency_list | ( | string::const_iterator | first, |
string::const_iterator | last, | ||
std::vector< std::vector< dependency > > * | out | ||
) |
Parse dependency list.
first | the beginning of the sequence |
last | the end of the sequence |
out | a vector to which the list is written |
References parse_dependency_alt_list().
Referenced by pkg::pkgbase::remove_auto().
unsigned int pkg::platform_features | ( | ) |
Check platform features.
References pkg::os::call_swi(), and pkg::swi::OS_PlatformFeatures.
Referenced by pkg::arm26_check::arm26_check(), pkg::arm_check::arm_check(), and pkg::swp_check::swp_check().
string pkg::canonicalise | ( | const string & | pathname | ) |
Canonicalise pathname.
pathname | the pathname to be canonicalised |
References pkg::os::OS_FSControl37().
Referenced by boot_drive_relative(), pkg::boot_options_file::name_in_section(), and pkg::path_table::operator()().
void pkg::force_delete | ( | const string & | pathname | ) |
Delete file without regard for file attributes.
If the file attributes prevent deletion then they are changed. It is not an error if the file does not exist. It is an error if the file cannot be deleted (after attempting to change the file attributes).
pathname | the pathname of the file to be deleted |
References pkg::os::OS_File4(), and pkg::os::OS_File6().
Referenced by pkg::boot_options_file::commit(), pkg::component_update::commit(), pkg::status_table::commit(), pkg::binary_control_table::commit(), pkg::path_table::commit(), pkg::triggers::copy_post_remove_file(), pkg::component_update::done(), pkg::unpack::poll(), pkg::triggers::remove_post_remove_file(), and update_sysvars().
void pkg::soft_delete | ( | const string & | pathname | ) |
Delete file without changing file attributes It is not an error if the file does not exist.
It is not an error if the file cannot be deleted (due to attributes or other reasons).
pathname | the pathname of the file to be deleted |
References pkg::os::OS_File6().
Referenced by pkg::zipfile::extract(), and pkg::unpack::poll().
void pkg::force_move | ( | const string & | src_pathname, |
const string & | dst_pathname, | ||
bool | overwrite = false |
||
) |
Move file without regard for file attributes.
If the file attributes prevent movement then they are changed for the duration of the operation then restored afterwards. If the overwrite flag is set then an existng file at the destination will be overwritten, also without regard for its file attributes. It is an error if the source file does not exist, or cannot be moved (after changing its attributes if necessary). It is not an error if overwrite is requested but the destination does not exist. The source and destination must be on the same disc.
src_pathname | the pathname of the file to be moved. |
dst_pathname | the pathname the file is to be moved to. |
overwrite | true if overwriting permitted, otherwise false. |
References pkg::os::OS_File17(), pkg::os::OS_File4(), pkg::os::OS_File6(), and pkg::os::OS_FSControl25().
Referenced by pkg::boot_options_file::commit(), pkg::component_update::commit(), pkg::status_table::commit(), pkg::binary_control_table::commit(), pkg::path_table::commit(), pkg::unpack::poll(), and update_sysvars().
void pkg::copy_object | ( | const string & | src_pathname, |
const string & | dst_pathname | ||
) |
Recursively copy object.
src_pathname | the pathname of the object to be moved. |
dst_pathname | the pathname the object is to be moved to. |
References pkg::os::OS_FSControl26().
Referenced by pkg::triggers::copy_post_remove_file().
void pkg::create_directory | ( | const string & | pathname | ) |
Create directory.
pathname | the required pathname |
References pkg::os::OS_File8().
Referenced by pkg::boot_options_file::commit(), pkg::pkgbase::pkgbase(), and pkg::unpack::poll().
void pkg::write_file_info | ( | const string & | pathname, |
unsigned int | loadaddr, | ||
unsigned int | execaddr, | ||
unsigned int | attr | ||
) |
Write file information.
A filetype and timestamp may be given in place of a load address and execution address by encoding them in the normal way.
pathname | the pathname of the file |
loadaddr | the required load address |
execaddr | the required execution address |
attr | the required file attributes |
References pkg::os::OS_File1().
Referenced by pkg::unpack::poll().
void pkg::write_filetype | ( | const string & | pathname, |
unsigned int | filetype | ||
) |
Write filetype.
pathname | the pathname of the file |
filetype | the required filetype |
References pkg::os::OS_File18().
Referenced by pkg::boot_options_file::commit(), and update_sysvars().
unsigned int pkg::object_type | ( | const string & | pathname | ) |
Get object type.
pathname | the pathname |
References pkg::os::OS_File17().
Referenced by pkg::boot_options_file::commit(), pkg::component_update::commit(), pkg::status_table::commit(), pkg::binary_control_table::commit(), pkg::path_table::commit(), pkg::component_update::done(), pkg::update::poll(), pkg::commit::poll(), pkg::unpack::poll(), update_sysvars(), and pkg::pkgbase::verify_cached_file().
unsigned int pkg::object_length | ( | const string & | pathname | ) |
Get object length.
pathname | the pathname |
References pkg::os::OS_File17().
Referenced by pkg::update::poll(), pkg::unpack::poll(), and pkg::pkgbase::verify_cached_file().
std::string pkg::boot_drive_relative | ( | const string & | pathname | ) |
Get version of pathname made relative the the boot drive.
pathname | the pathname |
References canonicalise().
Referenced by pkg::commit::poll().
|
inline |
Make a copy of a string if it's not null.
str | string to copy |
Referenced by pkg::log_entry::log_entry(), and pkg::log_entry::operator=().
std::ostream & pkg::operator<< | ( | std::ostream & | stream, |
const log & | olog | ||
) |
|
inline |
Referenced by pkg::path_table::find(), and pkg::path_table::operator()().
string pkg::resolve_pathrefs | ( | const path_table & | table, |
const string & | in | ||
) |
Resolve logical path references.
If a string is passed through this function before it is GSTransed then system variable references of the form <Packages$>, where x is a logical pathname, are resolved to the corresponding physical pathname.
Note that the string is not GSTransed, and system variable references that are not of the above form are not expanded.
table | the path table for lookups |
in | the string to be processed |
Referenced by update_sysvars().
void pkg::update_sprite_pool | ( | pkgbase & | pb | ) |
Update sprite pool.
Sprites are found and merged into a single sprite file which is loaded at boot time.
pb | the package database |
Referenced by pkg::commit::poll().
bool pkg::can_process | ( | const version & | standards_version | ) |
Test whether standards version can be processed by this library.
Referenced by pkg::unpack::poll().
Test whether two status records are equal.
lhs | the left hand side |
rhs | the right hand side |
References pkg::status::environment_id(), pkg::status::flags(), pkg::status::state(), and pkg::status::version().
Referenced by pkg::version::package_version().
Test whether two status records are unequal.
lhs | the left hand side |
rhs | the right hand side |
References pkg::status::environment_id(), pkg::status::flags(), pkg::status::state(), and pkg::status::version().
Referenced by pkg::version::package_version().
std::ostream & pkg::operator<< | ( | std::ostream & | out, |
const std::pair< string, status > & | pkgstat | ||
) |
Write package status record to output stream.
out | the output stream |
pkgstat | the package status record |
std::istream & pkg::operator>> | ( | std::istream & | in, |
std::pair< string, status > & | pkgstat | ||
) |
Read package status record from input stream.
in | the input stream |
pkgstat | the package status record |
References pkg::status::flags().
Determine whether a package should be unpacked.
The result will be true if:
curstat | the current status |
selstat | the selected status |
References pkg::status::environment_id(), pkg::status::state(), pkg::status::state_unpacked, and pkg::status::version().
Referenced by pkg::commit::poll(), and pkg::unpack::unpack().
Determine whether a package should be removed.
A package should be removed if:
curstat | the current status |
selstat | the selected status |
References pkg::status::environment_id(), pkg::status::state(), pkg::status::state_removed, and pkg::status::version().
Referenced by pkg::commit::poll(), and pkg::unpack::unpack().
Determine whether a package should be configured.
A package should be configured if:
It may be necessary for it to be unpacked before this can happen.
curstat | the current status |
selstat | the selected status |
References pkg::status::environment_id(), pkg::status::state(), pkg::status::state_installed, and pkg::status::version().
Referenced by pkg::commit::poll().
Determine whether a package should be purged.
A package should be purged if:
It may be necessary for it to be removed before this can happen.
curstat | the current status |
selstat | the selected status |
References pkg::status::state(), and pkg::status::state_not_present.
Referenced by pkg::commit::poll().
void pkg::update_sysvars | ( | pkgbase & | pb | ) |
Update system variable definitions.
System variable definitions are found and merged into a single obey file which is executed at boot time.
pb | the package database |
References dst_pathname, pkg::dirstream::object::filetype, force_delete(), force_move(), pkg::dirstream::object::name, object_type(), pkg::os::OS_SetVarVal(), pkg::pkgbase::paths(), resolve_pathrefs(), pkg::pkgbase::setvars_pathname(), pkg::pkgbase::sysvars_pathname(), and write_filetype().
Referenced by pkg::commit::poll().
const std::string pkg::post_remove_dirname | ( | "PRTriggers" | ) |
The temporary directory for post remove triggers.
Triggers are copied to this directory, so they can be run after all the files for the package have been removed.
Referenced by dst_to_post_remove().
std::string pkg::dst_to_post_remove | ( | const std::string & | dst_pathname | ) |
Convert destination pathname to pathname for post remove triggers.
dst_pathname | the destination pathname |
References post_remove_dirname().
Referenced by pkg::triggers::copy_post_remove_file(), and pkg::triggers::remove_post_remove_file().
Test whether two versions are equal.
lhs | the left hand side |
rhs | the right hand side |
Test whether two versions are unequal.
lhs | the left hand side |
rhs | the right hand side |
Test whether one version is less than another.
lhs | the left hand side |
rhs | the right hand side |
Test whether one version is greater than or equal to another.
lhs | the left hand side |
rhs | the right hand side |
Referenced by pkg::version::package_version().
Test whether one version is less than or equal to another.
lhs | the left hand side |
rhs | the right hand side |
Referenced by pkg::version::package_version().
Test whether one version is greater than another.
lhs | the left hand side |
rhs | the right hand side |
Referenced by pkg::version::package_version().
const char* pkg::ComponentFlagNames[] |
const char pkg::ENV_MODULE_SEP = '\x01' |
Referenced by pkg::env_checker::package_env().
const char* pkg::error_text[] |
const char* pkg::warning_text[] |
const char* pkg::trace_text[] |
const char* pkg::info_text[] |
struct pkg::log_text_item pkg::log_text[] |
Referenced by pkg::log_entry::text().
Reference Manual | LibPkg | Version 0.6.1 (28 Jan 2015) |