LibPkg
|
A class for representing the collection of package database tables. More...
#include <pkgbase.h>
Classes | |
class | cache_error |
An exception class for reporting cache errors. More... | |
Public Member Functions | |
pkgbase (const string &pathname, const string &dpathname, const string &cpathname) | |
Create pkgbase object. More... | |
~pkgbase () | |
Destroy pkgbase object. More... | |
status_table & | curstat () |
Get current status table. More... | |
status_table & | selstat () |
Get selected status table. More... | |
status_table & | prevstat () |
Get previous status table. More... | |
binary_control_table & | control () |
Get binary control table. More... | |
source_table & | sources () |
Get source table. More... | |
path_table & | paths () |
Get path table. More... | |
string | list_pathname (const string &url) |
Get pathname for index file from given source. More... | |
string | available_pathname () |
Get pathname for available list file. More... | |
string | cache_pathname (const string &pkgname, const string &pkgvrsn) |
Get pathname for package in cache. More... | |
string | info_pathname (const string &pkgname) |
Get pathname for info directory of package. More... | |
string | sysvars_pathname () |
Get pathname for sysvars directory. More... | |
string | sprites_pathname () |
Get pathname for sprites directory. More... | |
string | setvars_pathname () |
Get pathname for setvars file. More... | |
string | bootsprites_pathname () |
Get pathname for sprites file. More... | |
string | component_update_pathname () |
Get pathname for component update file. More... | |
void | verify_cached_file (const binary_control &ctrl) |
Verify file in cache. More... | |
bool | fix_dependencies (const std::set< string > &seed) |
Fix dependencies. More... | |
void | remove_auto () |
Remove redundant auto-installed packages. More... | |
A class for representing the collection of package database tables.
pkg::pkgbase::pkgbase | ( | const string & | pathname, |
const string & | dpathname, | ||
const string & | cpathname | ||
) |
Create pkgbase object.
pathname | the pathname of the !Packages directory. |
dpathname | the pathname of the default choices directory |
cpathname | the pathname of the choices directory |
References pkg::create_directory().
pkg::pkgbase::~pkgbase | ( | ) |
Destroy pkgbase object.
|
inline |
Get current status table.
Referenced by pkg::commit::commit(), pkg::commit::poll(), pkg::unpack::poll(), and pkg::unpack::unpack().
|
inline |
Get selected status table.
Referenced by pkg::commit::commit(), fix_dependencies(), pkg::commit::poll(), remove_auto(), and pkg::unpack::unpack().
|
inline |
Get previous status table.
This is the state to which packages are restored when changes are unwound after an error.
Referenced by pkg::commit::commit().
|
inline |
Get binary control table.
Referenced by pkg::commit::poll(), and pkg::trigger::trigger().
|
inline |
Get source table.
|
inline |
Get path table.
Referenced by pkg::commit::poll(), pkg::trigger::trigger(), and pkg::update_sysvars().
string pkg::pkgbase::list_pathname | ( | const string & | url | ) |
Get pathname for index file from given source.
url | the URL of the source |
string pkg::pkgbase::available_pathname | ( | ) |
Get pathname for available list file.
string pkg::pkgbase::cache_pathname | ( | const string & | pkgname, |
const string & | pkgvrsn | ||
) |
Get pathname for package in cache.
pkgname | the package name |
pkgvrsn | the package version |
Referenced by pkg::commit::poll(), and verify_cached_file().
string pkg::pkgbase::info_pathname | ( | const string & | pkgname | ) |
Get pathname for info directory of package.
pkgname | the package name |
string pkg::pkgbase::sysvars_pathname | ( | ) |
string pkg::pkgbase::sprites_pathname | ( | ) |
Get pathname for sprites directory.
string pkg::pkgbase::setvars_pathname | ( | ) |
string pkg::pkgbase::bootsprites_pathname | ( | ) |
Get pathname for sprites file.
string pkg::pkgbase::component_update_pathname | ( | ) |
void pkg::pkgbase::verify_cached_file | ( | const binary_control & | ctrl | ) |
Verify file in cache.
This function checks first whether a suitably named file exists, then whether it has the correct length, then whether it has the correct MD5Sum. If any of these tests fail then a cache error is thrown.
ctrl | a control record for the requested package |
References cache_pathname(), pkg::control::end(), pkg::control::find(), pkg::object_length(), pkg::object_type(), pkg::control::pkgname(), and pkg::control::version().
Referenced by pkg::commit::poll().
bool pkg::pkgbase::fix_dependencies | ( | const std::set< string > & | seed | ) |
Fix dependencies.
If a package is in the seed set then its selection state cannot change from installed to removed or vice-versa. If it is not in the seed set then it can be installed or removed as necessary to meet all dependencies.
seed | the seed set |
References pkg::status_table::begin(), pkg::status_table::end(), pkg::status::flag(), pkg::status::flag_auto, pkg::status::flag_must_install, pkg::status::flag_must_remove, pkg::status::flag_must_upgrade, pkg::status_table::insert(), selstat(), pkg::status::state(), pkg::status::state_installed, pkg::status::state_removed, pkg::status::version(), and pkg::control::version().
Referenced by remove_auto().
void pkg::pkgbase::remove_auto | ( | ) |
Remove redundant auto-installed packages.
References pkg::status_table::begin(), pkg::status_table::end(), fix_dependencies(), pkg::status::flag(), pkg::status::flag_auto, pkg::status::flag_must_install, pkg::status::flag_must_remove, pkg::status::flag_must_upgrade, pkg::status_table::insert(), selstat(), pkg::status::state(), pkg::status::state_installed, pkg::status::state_removed, and pkg::status::version().
Reference Manual | LibPkg | Version 0.6.1 (28 Jan 2015) |