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

The namespace used to hold the package management library. More...

Namespaces

 os
 
 swi
 

Classes

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...
 
class  look_at_options
 Class to configure the look at options file in the Desktop file. More...
 
class  run_options
 Class to configure the run options in the Desktop file. More...
 
class  add_to_apps_options
 Class to configure the add to apps option section in the PreDeskop file. 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...
 
struct  log_text_item
 
class  log_entry
 A class to represent one log entry. More...
 
class  log
 Class to log actions that occur in LibPkg. More...
 
class  md5
 A class for producing MD5 message digests. 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  pkgbase
 A class for representing the collection of package database tables. 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  table
 A base class to represent a data table. More...
 
class  thread
 A mixin class to represent a cooperative thread. More...
 
struct  case_insensitive_cmp
 Comparison that does not take into account the case of the string. More...
 
class  unpack
 A class for unpacking and removing sets of packages. 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  zipfile
 An interface class to represent a zip file. More...
 

Enumerations

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_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_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_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_UNPACK_FILES, LOG_INFO_UNPACK_REPLACE, LOG_INFO_UNPACK_REMOVE, LOG_INFO_UNPACK_REMOVED,
  LOG_INFO_UNPACKED_PACKAGE, LOG_INFO_UNPACK_DONE, LOG_INFO_UNWIND_REPLACED_FILES, LOG_INFO_UNWIND_REMOVED,
  LOG_INFO_UNWIND_UNPACK_FILES, 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
}
 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...
 
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...
 
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 * 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

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_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_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_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_UNPACK_FILES 
LOG_INFO_UNPACK_REPLACE 
LOG_INFO_UNPACK_REMOVE 
LOG_INFO_UNPACK_REMOVED 
LOG_INFO_UNPACKED_PACKAGE 
LOG_INFO_UNPACK_DONE 
LOG_INFO_UNWIND_REPLACED_FILES 
LOG_INFO_UNWIND_REMOVED 
LOG_INFO_UNWIND_UNPACK_FILES 
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 

Function Documentation

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::pkgname, and pkg::binary_control_table::key_type::pkgvrsn.

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

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

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

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

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

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

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

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

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::binary_control_table::commit(), pkg::path_table::commit(), pkg::component_update::done(), 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).

Parameters
pathnamethe pathname of the file to be deleted

References pkg::os::OS_File6().

Referenced by pkg::zipfile::extract().

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::binary_control_table::commit(), pkg::path_table::commit(), and update_sysvars().

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

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(), and pkg::pkgbase::pkgbase().

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

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

unsigned int pkg::object_type ( const string &  pathname)
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::pkgbase::verify_cached_file().

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

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

std::ostream & pkg::operator<< ( std::ostream &  stream,
const log &  olog 
)
bool pkg::is_alias ( const std::string &  src_pathname)
inline
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().

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

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
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::flags(), pkg::status::state(), and pkg::status::version().

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::flags(), pkg::status::state(), and pkg::status::version().

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

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::state(), pkg::status::state_unpacked, and pkg::status::version().

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

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::state(), pkg::status::state_removed, and pkg::status::version().

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

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::state(), pkg::status::state_installed, and pkg::status::version().

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

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

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

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

Variable Documentation

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

Referenced by pkg::component::operator std::string().

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"
}
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"
}

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

const char* pkg::trace_text[]
Initial value:
=
{
"Trace: %0",
"Trace: %0 %1"
}
const char* pkg::info_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:16
const char * trace_text[]
Definition: log.cc:41
const char * warning_text[]
Definition: log.cc:28
const char * info_text[]
Definition: log.cc:46

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


Reference Manual LibPkg Version 0.6.1 (28 Jan 2015)