LibPkg
Namespaces | Classes | Enumerations | Functions | Variables
pkg Namespace Reference

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 to run on a 26 bit version of RISC OS. More...
 
class  arm32_check
 Class for packages that need to run on a 32 bit version of RISC OS. More...
 
class  arm_check
 Class for packages that need to run 32 bit code. 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...
 

Enumerations

enum  env_check_type { System, Module, Unknown, Unset }
 Type for check. More...
 
enum  LogCode {
  LOG_ERROR_UNINITIALISED = 0, LOG_ERROR_UPDATE_EXCEPTION, LOG_ERROR_SOURCE_DOWNLOAD_FAILED, LOG_ERROR_CACHE_INSERT,
  LOG_ERROR_PACKAGE_DOWNLOAD_FAILED, LOG_ERROR_UNPACK_FAILED, LOG_ERROR_UNPACK_EXCEPTION, LOG_ERROR_PATHS_COMMIT,
  LOG_ERROR_PATHS_ROLLBACK, LOG_ERROR_POST_REMOVE_COPY, LOG_WARNING_LOG_TEXT = 0x10000, LOG_WARNING_REMOVE_COMPONENT,
  LOG_WARNING_BOOT_OPTIONS_FAILED, LOG_WARNING_COMPONENT_NOT_INSTALLED, LOG_WARNING_BOOTING_FAILED, LOG_WARNING_RUNNING_FAILED,
  LOG_WARNING_ADDING_TO_APPS_FAILED, LOG_WARNING_COMPONENT_UPDATE_DONE_FAILED, LOG_WARNING_MODULE_PACKAGE_UPDATE_FAILED, LOG_WARNING_NO_TRIGGER_RUN,
  LOG_WARNING_POST_REMOVE_TRIGGER_FAILED, LOG_WARNING_POST_INSTALL_TRIGGER_FAILED, LOG_TRACE = 0x20000, LOG_TRACE2,
  LOG_INFO_READ_SOURCES = 0x30000, LOG_INFO_DOWNLOADING_SOURCES, LOG_INFO_DOWNLOADING_SOURCE, LOG_INFO_DOWNLOADED_SOURCE,
  LOG_INFO_DOWNLOADED_SOURCES, LOG_INFO_ADDING_AVAILABLE, LOG_INFO_AVAILABLE_ADDED, LOG_INFO_ADD_LOCAL,
  LOG_INFO_UPDATING_DATABASE, LOG_INFO_UPDATE_DONE, LOG_INFO_START_COMMIT, LOG_INFO_PREPROCESS_PACKAGE,
  LOG_INFO_CACHE_USED, LOG_INFO_NOT_USING_CACHE, LOG_INFO_DOWNLOADING_PACKAGE, LOG_INFO_DOWNLOADED_PACKAGE,
  LOG_INFO_UNPACKING, LOG_INFO_UNPACKED, LOG_INFO_INSTALLED, LOG_INFO_STATE_UPDATE,
  LOG_INFO_PURGED, LOG_INFO_UPDATING_SYSVARS, LOG_INFO_SYSVARS_UPDATED, LOG_INFO_UPDATING_SPRITES,
  LOG_INFO_SPRITES_UPDATED, LOG_INFO_COMMIT_DONE, LOG_INFO_PREUNPACK, LOG_INFO_PREREMOVE,
  LOG_INFO_UNPACKING_PACKAGE, LOG_INFO_REMOVE_FILES_REPLACED_BY_DIRS, LOG_INFO_UNPACK_FILES, LOG_INFO_UNPACK_REPLACE,
  LOG_INFO_UNPACK_REMOVE, LOG_INFO_UNPACK_REMOVED, LOG_INFO_UNPACKED_PACKAGE, LOG_INFO_CREATE_EMPTY_DIRS,
  LOG_INFO_UNPACK_DONE, LOG_INFO_UNWIND_EMPTY_DIRS, LOG_INFO_UNWIND_REPLACED_FILES, LOG_INFO_UNWIND_REMOVED,
  LOG_INFO_UNWIND_UNPACK_FILES, LOG_INFO_UNWIND_REMOVE_FILES_REPLACED_BY_DIRS, LOG_INFO_RESTORE_CONTROL, LOG_INFO_UNWIND_STATE,
  LOG_INFO_UNWIND_STATE_REMOVED, LOG_INFO_UNWIND_DONE, LOG_INFO_START_PATHS, LOG_INFO_REMOVE_PATH_OPTS,
  LOG_INFO_PATH_CHANGE, LOG_INFO_END_PATHS, LOG_INFO_UPDATING_BOOT_OPTIONS, LOG_INFO_BOOT_OPTIONS_UPDATED,
  LOG_INFO_BOOTING_FILES, LOG_INFO_BOOTING, LOG_INFO_RUNNING_FILES, LOG_INFO_RUNNING,
  LOG_INFO_ADDING_TO_APPS, LOG_INFO_ADDING, LOG_INFO_WARNING_INTRO1, LOG_INFO_WARNING_INTRO2,
  LOG_INFO_MODULE_CHECK, LOG_INFO_MODULE_USE, LOG_INFO_MODULE_REPLACE, LOG_INFO_MODULE_UPDATE,
  LOG_INFO_MODULE_UNWIND, LOG_INFO_POST_TRIGGER_CHECK, LOG_INFO_TRIGGER_RUN, LOG_INFO_TRIGGER_OUTPUT,
  LOG_INFO_PRE_REMOVE_TRIGGERS, LOG_INFO_PRE_INSTALL_TRIGGERS, LOG_INFO_COPY_POST_REMOVE, LOG_INFO_UNWIND_PRE_INSTALL_TRIGGERS,
  LOG_INFO_UNWIND_PRE_REMOVE_TRIGGERS, LOG_INFO_REMOVE_POST_REMOVE_TRIGGERS, LOG_INFO_POST_REMOVE_TRIGGERS, LOG_INFO_POST_INSTALL_TRIGGERS,
  LOG_INFO_DELETE_SHARED_VAR, LOG_INFO_PACKAGE_ENV, LOG_INFO_DOWNLOAD_INFO, LOG_INFO_DOWNLOAD_DATA,
  LOG_INFO_DOWNLOAD_HEADER
}
 An enumeration of all the items that can be logged. 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 []
 

Detailed Description

The namespace used to hold the package management library.

Enumeration Type Documentation

◆ env_check_type

Type for check.

Enumerator
System 

System check.

Module 

Module check.

Unknown 

Check unknown to this version of libpkg.

Unset 

No check defined on package.

◆ LogCode

An enumeration of all the items that can be logged.

Enumerator
LOG_ERROR_UNINITIALISED 
LOG_ERROR_UPDATE_EXCEPTION 
LOG_ERROR_SOURCE_DOWNLOAD_FAILED 
LOG_ERROR_CACHE_INSERT 
LOG_ERROR_PACKAGE_DOWNLOAD_FAILED 
LOG_ERROR_UNPACK_FAILED 
LOG_ERROR_UNPACK_EXCEPTION 
LOG_ERROR_PATHS_COMMIT 
LOG_ERROR_PATHS_ROLLBACK 
LOG_ERROR_POST_REMOVE_COPY 
LOG_WARNING_LOG_TEXT 
LOG_WARNING_REMOVE_COMPONENT 
LOG_WARNING_BOOT_OPTIONS_FAILED 
LOG_WARNING_COMPONENT_NOT_INSTALLED 
LOG_WARNING_BOOTING_FAILED 
LOG_WARNING_RUNNING_FAILED 
LOG_WARNING_ADDING_TO_APPS_FAILED 
LOG_WARNING_COMPONENT_UPDATE_DONE_FAILED 
LOG_WARNING_MODULE_PACKAGE_UPDATE_FAILED 
LOG_WARNING_NO_TRIGGER_RUN 
LOG_WARNING_POST_REMOVE_TRIGGER_FAILED 
LOG_WARNING_POST_INSTALL_TRIGGER_FAILED 
LOG_TRACE 
LOG_TRACE2 
LOG_INFO_READ_SOURCES 
LOG_INFO_DOWNLOADING_SOURCES 
LOG_INFO_DOWNLOADING_SOURCE 
LOG_INFO_DOWNLOADED_SOURCE 
LOG_INFO_DOWNLOADED_SOURCES 
LOG_INFO_ADDING_AVAILABLE 
LOG_INFO_AVAILABLE_ADDED 
LOG_INFO_ADD_LOCAL 
LOG_INFO_UPDATING_DATABASE 
LOG_INFO_UPDATE_DONE 
LOG_INFO_START_COMMIT 
LOG_INFO_PREPROCESS_PACKAGE 
LOG_INFO_CACHE_USED 
LOG_INFO_NOT_USING_CACHE 
LOG_INFO_DOWNLOADING_PACKAGE 
LOG_INFO_DOWNLOADED_PACKAGE 
LOG_INFO_UNPACKING 
LOG_INFO_UNPACKED 
LOG_INFO_INSTALLED 
LOG_INFO_STATE_UPDATE 
LOG_INFO_PURGED 
LOG_INFO_UPDATING_SYSVARS 
LOG_INFO_SYSVARS_UPDATED 
LOG_INFO_UPDATING_SPRITES 
LOG_INFO_SPRITES_UPDATED 
LOG_INFO_COMMIT_DONE 
LOG_INFO_PREUNPACK 
LOG_INFO_PREREMOVE 
LOG_INFO_UNPACKING_PACKAGE 
LOG_INFO_REMOVE_FILES_REPLACED_BY_DIRS 
LOG_INFO_UNPACK_FILES 
LOG_INFO_UNPACK_REPLACE 
LOG_INFO_UNPACK_REMOVE 
LOG_INFO_UNPACK_REMOVED 
LOG_INFO_UNPACKED_PACKAGE 
LOG_INFO_CREATE_EMPTY_DIRS 
LOG_INFO_UNPACK_DONE 
LOG_INFO_UNWIND_EMPTY_DIRS 
LOG_INFO_UNWIND_REPLACED_FILES 
LOG_INFO_UNWIND_REMOVED 
LOG_INFO_UNWIND_UNPACK_FILES 
LOG_INFO_UNWIND_REMOVE_FILES_REPLACED_BY_DIRS 
LOG_INFO_RESTORE_CONTROL 
LOG_INFO_UNWIND_STATE 
LOG_INFO_UNWIND_STATE_REMOVED 
LOG_INFO_UNWIND_DONE 
LOG_INFO_START_PATHS 
LOG_INFO_REMOVE_PATH_OPTS 
LOG_INFO_PATH_CHANGE 
LOG_INFO_END_PATHS 
LOG_INFO_UPDATING_BOOT_OPTIONS 
LOG_INFO_BOOT_OPTIONS_UPDATED 
LOG_INFO_BOOTING_FILES 
LOG_INFO_BOOTING 
LOG_INFO_RUNNING_FILES 
LOG_INFO_RUNNING 
LOG_INFO_ADDING_TO_APPS 
LOG_INFO_ADDING 
LOG_INFO_WARNING_INTRO1 
LOG_INFO_WARNING_INTRO2 
LOG_INFO_MODULE_CHECK 
LOG_INFO_MODULE_USE 
LOG_INFO_MODULE_REPLACE 
LOG_INFO_MODULE_UPDATE 
LOG_INFO_MODULE_UNWIND 
LOG_INFO_POST_TRIGGER_CHECK 
LOG_INFO_TRIGGER_RUN 
LOG_INFO_TRIGGER_OUTPUT 
LOG_INFO_PRE_REMOVE_TRIGGERS 
LOG_INFO_PRE_INSTALL_TRIGGERS 
LOG_INFO_COPY_POST_REMOVE 
LOG_INFO_UNWIND_PRE_INSTALL_TRIGGERS 
LOG_INFO_UNWIND_PRE_REMOVE_TRIGGERS 
LOG_INFO_REMOVE_POST_REMOVE_TRIGGERS 
LOG_INFO_POST_REMOVE_TRIGGERS 
LOG_INFO_POST_INSTALL_TRIGGERS 
LOG_INFO_DELETE_SHARED_VAR 
LOG_INFO_PACKAGE_ENV 
LOG_INFO_DOWNLOAD_INFO 
LOG_INFO_DOWNLOAD_DATA 
LOG_INFO_DOWNLOAD_HEADER 

Function Documentation

◆ operator<() [1/2]

bool pkg::operator< ( const binary_control_table::key_type lhs,
const binary_control_table::key_type rhs 
)

Compare two binary control table keys.

Parameters
lhsthe left hand side
rhsthe right hand side
Returns
true if lhs<rhs, otherwise false

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().

◆ parse_component_list()

void pkg::parse_component_list ( std::string::const_iterator  first,
std::string::const_iterator  last,
std::vector< component > *  out 
)

Parse component list.

Parameters
firstthe beginning of the sequence
lastthe end of the sequence
outa vector to which the coponents are added

Referenced by pkg::commit::poll(), and pkg::trigger::trigger().

◆ operator<<() [1/4]

std::ostream & pkg::operator<< ( std::ostream &  out,
const component comp 
)

Write component record to output stream.

Parameters
outthe output stream
compthe component record
Returns
the output stream

References pkg::component::path().

Referenced by pkg::log::entry().

◆ operator>>() [1/3]

std::istream & pkg::operator>> ( std::istream &  in,
component comp 
)

Read component record from input stream.

Parameters
inthe input stream
compthe component record
Returns
the input stream

References pkg::component::component(), and pkg::component::path().

◆ operator<<() [2/4]

std::ostream & pkg::operator<< ( std::ostream &  out,
const control ctrl 
)

Write control file to output stream.

Parameters
outthe output stream
ctrlthe control file
Returns
the output stream

References pkg::control::begin(), and pkg::control::end().

◆ operator>>() [2/3]

std::istream & pkg::operator>> ( std::istream &  in,
control ctrl 
)

Read control file from input stream.

Parameters
inthe input stream
ctrlthe control file
Returns
the output stream

References pkg::control::end(), and pkg::control::find().

◆ parse_dependency_alt_list()

void pkg::parse_dependency_alt_list ( string::const_iterator  first,
string::const_iterator  last,
std::vector< dependency > *  out 
)

Parse dependency alternatives list.

Parameters
firstthe beginning of the sequence
lastthe end of the sequence
outa vector to which the list is written

Referenced by parse_dependency_list().

◆ 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.

Parameters
firstthe beginning of the sequence
lastthe end of the sequence
outa vector to which the list is written

References parse_dependency_alt_list().

Referenced by pkg::pkgbase::remove_auto().

◆ platform_features()

unsigned int pkg::platform_features ( )

◆ canonicalise()

string pkg::canonicalise ( const string &  pathname)

Canonicalise pathname.

Parameters
pathnamethe pathname to be canonicalised
Returns
the canonicalised pathname

References pkg::os::OS_FSControl37().

Referenced by boot_drive_relative(), pkg::boot_options_file::name_in_section(), and pkg::path_table::operator()().

◆ force_delete()

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).

Parameters
pathnamethe 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::path_table::commit(), pkg::binary_control_table::commit(), pkg::triggers::copy_post_remove_file(), pkg::component_update::done(), pkg::unpack::poll(), pkg::triggers::remove_post_remove_file(), and update_sysvars().

◆ soft_delete()

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).

Parameters
pathnamethe pathname of the file to be deleted

References pkg::os::OS_File6().

Referenced by pkg::zipfile::extract(), and pkg::unpack::poll().

◆ force_move()

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.

Parameters
src_pathnamethe pathname of the file to be moved.
dst_pathnamethe pathname the file is to be moved to.
overwritetrue 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::path_table::commit(), pkg::binary_control_table::commit(), pkg::unpack::poll(), and update_sysvars().

◆ copy_object()

void pkg::copy_object ( const string &  src_pathname,
const string &  dst_pathname 
)

Recursively copy object.

Parameters
src_pathnamethe pathname of the object to be moved.
dst_pathnamethe pathname the object is to be moved to.

References pkg::os::OS_FSControl26().

Referenced by pkg::triggers::copy_post_remove_file().

◆ create_directory()

void pkg::create_directory ( const string &  pathname)

Create directory.

Parameters
pathnamethe required pathname

References pkg::os::OS_File8().

Referenced by pkg::boot_options_file::commit(), pkg::pkgbase::pkgbase(), and pkg::unpack::poll().

◆ write_file_info()

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.

Parameters
pathnamethe pathname of the file
loadaddrthe required load address
execaddrthe required execution address
attrthe required file attributes

References pkg::os::OS_File1().

Referenced by pkg::unpack::poll().

◆ write_filetype()

void pkg::write_filetype ( const string &  pathname,
unsigned int  filetype 
)

Write filetype.

Parameters
pathnamethe pathname of the file
filetypethe required filetype

References pkg::os::OS_File18().

Referenced by pkg::boot_options_file::commit(), and update_sysvars().

◆ object_type()

unsigned int pkg::object_type ( const string &  pathname)

◆ object_length()

unsigned int pkg::object_length ( const string &  pathname)

Get object length.

Parameters
pathnamethe pathname
Returns
the object length

References pkg::os::OS_File17().

Referenced by pkg::update::poll(), pkg::unpack::poll(), and pkg::pkgbase::verify_cached_file().

◆ boot_drive_relative()

std::string pkg::boot_drive_relative ( const string &  pathname)

Get version of pathname made relative the the boot drive.

Parameters
pathnamethe pathname
Returns
boot relative pathname or original if not on the boot drive

References canonicalise().

Referenced by pkg::commit::poll().

◆ copystr()

char* pkg::copystr ( const char *  str)
inline

Make a copy of a string if it's not null.

Parameters
strstring to copy
Returns
string copy or 0 if str is 0

Referenced by pkg::log_entry::log_entry(), and pkg::log_entry::operator=().

◆ operator<<() [3/4]

std::ostream & pkg::operator<< ( std::ostream &  stream,
const log olog 
)

◆ is_alias()

bool pkg::is_alias ( const std::string &  src_pathname)
inline

◆ resolve_pathrefs()

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.

Parameters
tablethe path table for lookups
inthe string to be processed
Returns
the string with logical path references resolved

Referenced by update_sysvars().

◆ update_sprite_pool()

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.

Parameters
pbthe package database

Referenced by pkg::commit::poll().

◆ can_process()

bool pkg::can_process ( const version standards_version)

Test whether standards version can be processed by this library.

Returns
true if standards version can be processed, otherwise false

Referenced by pkg::unpack::poll().

◆ operator==() [1/2]

bool pkg::operator== ( const status lhs,
const status rhs 
)

Test whether two status records are equal.

Parameters
lhsthe left hand side
rhsthe right hand side
Returns
true if lhs==rhs, otherwise false.

References pkg::status::environment_id(), pkg::status::flags(), pkg::status::state(), and pkg::status::version().

Referenced by pkg::version::package_version().

◆ operator!=() [1/2]

bool pkg::operator!= ( const status lhs,
const status rhs 
)

Test whether two status records are unequal.

Parameters
lhsthe left hand side
rhsthe right hand side
Returns
true if lhs!=rhs, otherwise false.

References pkg::status::environment_id(), pkg::status::flags(), pkg::status::state(), and pkg::status::version().

Referenced by pkg::version::package_version().

◆ operator<<() [4/4]

std::ostream & pkg::operator<< ( std::ostream &  out,
const std::pair< string, status > &  pkgstat 
)

Write package status record to output stream.

Parameters
outthe output stream
pkgstatthe package status record
Returns
the output stream

◆ operator>>() [3/3]

std::istream & pkg::operator>> ( std::istream &  in,
std::pair< string, status > &  pkgstat 
)

Read package status record from input stream.

Parameters
inthe input stream
pkgstatthe package status record
Returns
the output stream

References pkg::status::flags().

◆ unpack_req()

bool pkg::unpack_req ( const status curstat,
const status selstat 
)

Determine whether a package should be unpacked.

The result will be true if:

  • the selected state is state_unpacked or higher; and
    • the current state is lower than state_unpacked; or
    • the selected version differs from the current version.
Parameters
curstatthe current status
selstatthe selected status
Returns
true if the package should be unpacked

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().

◆ remove_req()

bool pkg::remove_req ( const status curstat,
const status selstat 
)

Determine whether a package should be removed.

A package should be removed if:

  • the current state is higher than state_removed; and
    • the selected state is state_removed or lower; or
    • the selected version differs from the current version.
Parameters
curstatthe current status
selstatthe selected status
Returns
true if the package should be removed

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().

◆ config_req()

bool pkg::config_req ( const status curstat,
const status selstat 
)

Determine whether a package should be configured.

A package should be configured if:

  • the selected state is state_installed or higher; and
    • the current state is lower than state_installed; or
    • the selected version differs from the current version.

It may be necessary for it to be unpacked before this can happen.

Parameters
curstatthe current status
selstatthe selected status
Returns
true if the package should be configured

References pkg::status::environment_id(), pkg::status::state(), pkg::status::state_installed, and pkg::status::version().

Referenced by pkg::commit::poll().

◆ purge_req()

bool pkg::purge_req ( const status curstat,
const status selstat 
)

Determine whether a package should be purged.

A package should be purged if:

  • the selected state is state_not_present or lower; and
  • the current state is higher than state_not_present.

It may be necessary for it to be removed before this can happen.

Parameters
curstatthe current status
selstatthe selected status
Returns
true if the package should be purged

References pkg::status::state(), and pkg::status::state_not_present.

Referenced by pkg::commit::poll().

◆ update_sysvars()

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.

Parameters
pbthe 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().

◆ post_remove_dirname()

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().

◆ 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.

Parameters
dst_pathnamethe destination pathname
Returns
the pathname to be used in post remove triggers

References post_remove_dirname().

Referenced by pkg::triggers::copy_post_remove_file(), and pkg::triggers::remove_post_remove_file().

◆ operator==() [2/2]

bool pkg::operator== ( const version lhs,
const version rhs 
)

Test whether two versions are equal.

Parameters
lhsthe left hand side
rhsthe right hand side
Returns
true if lhs==rhs, otherwise false.

◆ operator!=() [2/2]

bool pkg::operator!= ( const version lhs,
const version rhs 
)

Test whether two versions are unequal.

Parameters
lhsthe left hand side
rhsthe right hand side
Returns
true if lhs!=rhs, otherwise false.

◆ operator<() [2/2]

bool pkg::operator< ( const version lhs,
const version rhs 
)

Test whether one version is less than another.

Parameters
lhsthe left hand side
rhsthe right hand side
Returns
true if lhs<rhs, otherwise false.

◆ operator>=()

bool pkg::operator>= ( const version lhs,
const version rhs 
)

Test whether one version is greater than or equal to another.

Parameters
lhsthe left hand side
rhsthe right hand side
Returns
true if lhs>=rhs, otherwise false.

Referenced by pkg::version::package_version().

◆ operator<=()

bool pkg::operator<= ( const version lhs,
const version rhs 
)

Test whether one version is less than or equal to another.

Parameters
lhsthe left hand side
rhsthe right hand side
Returns
true if lhs<=rhs, otherwise false.

Referenced by pkg::version::package_version().

◆ operator>()

bool pkg::operator> ( const version lhs,
const version rhs 
)

Test whether one version is greater than another.

Parameters
lhsthe left hand side
rhsthe right hand side
Returns
true if lhs>rhs, otherwise false.

Referenced by pkg::version::package_version().

Variable Documentation

◆ ComponentFlagNames

const char* pkg::ComponentFlagNames[]
Initial value:
=
{
"Movable",
"LookAt",
"Run",
"AddToApps"
}

◆ ENV_MODULE_SEP

const char pkg::ENV_MODULE_SEP = '\x01'

◆ error_text

const char* pkg::error_text[]
Initial value:
=
{
"Uninitialised log entry used",
"Exception in update package database from source lists: %0",
"Failed to download source from '%0', error: %1",
"Failed to insert package '%0' into cache, error: %1",
"Failed to download package '%0', error: %1",
"Failed to unpack the packages, error: %0",
"Error during unpacking '%0'",
"Failed to update paths for the components, error: %0",
"Failed to rollback paths after an error, rollback error: %0",
"Failed to copy post remove trigger '%0'"
}

◆ warning_text

const char* pkg::warning_text[]
Initial value:
=
{
"Missing log entry: ",
"Unable to parse components for removal for package '%0', error: %1",
"Failed to update '%0 boot options', error: %1",
"Component '%0' has not been installed'",
"Failed to Filer_Boot '%0', error: %1",
"Failed to Filer_Run '%0', error: %1",
"Failed to AddApp '%0', error: %1",
"Failed to mark component updates as done",
"Failed to update database to reflect existing module, error: %0",
"Package front end does not support triggers '%0' trigger for '%1' ignored",
"Post remove trigger failed for package '%0', error: '%1'",
"Post install trigger failed for package '%0', error: '%1'"
}

◆ trace_text

const char* pkg::trace_text[]
Initial value:
=
{
"Trace: %0",
"Trace: %0 %1"
}

◆ info_text

const char* pkg::info_text[]

◆ log_text

struct pkg::log_text_item pkg::log_text[]
Initial value:
=
{
{ sizeof(error_text) / sizeof(char *), error_text },
{ sizeof(warning_text) / sizeof(char *), warning_text },
{ sizeof(trace_text) / sizeof(char *), trace_text },
{ sizeof(info_text) / sizeof(char *), info_text },
}
const char * error_text[]
Definition: log.cc:27
const char * trace_text[]
Definition: log.cc:56
const char * warning_text[]
Definition: log.cc:40
const char * info_text[]
Definition: log.cc:61

Referenced by pkg::log_entry::text().


Reference Manual LibPkg Version 0.9.0 (4 Sep 2020)