Cupt
|
performs system modifications More...
#include <cupt/system/worker.hpp>
Classes | |
struct | Action |
action types More... | |
struct | ActionsPreview |
Public Member Functions | |
Worker (const shared_ptr< const Config > &config, const shared_ptr< const Cache > &cache) | |
constructor | |
void | setDesiredState (const Resolver::Offer &offer) |
void | setPackagePurgeFlag (const string &packageName, bool value) |
shared_ptr< const ActionsPreview > | getActionsPreview () const |
map< string, ssize_t > | getUnpackedSizesPreview () const |
pair< size_t, size_t > | getDownloadSizesPreview () const |
void | setAutomaticallyInstalledFlag (const string &packageName, bool value) |
void | changeSystem (const shared_ptr< download::Progress > &progress) |
void | updateReleaseAndIndexData (const shared_ptr< download::Progress > &progress) |
vector< pair< string, shared_ptr< const BinaryVersion > > > | getArchivesInfo () const |
gets available archives of binary versions | |
void | deleteArchive (const string &path) |
void | deletePartialArchives () |
void | saveSnapshot (const Snapshots &, const string &name) |
void | renameSnapshot (const Snapshots &, const string &previousName, const string &newName) |
void | removeSnapshot (const Snapshots &, const string &name) |
performs system modifications
cupt::system::Worker::Worker | ( | const shared_ptr< const Config > & | config, |
const shared_ptr< const Cache > & | cache | ||
) |
constructor
config | |
cache |
void cupt::system::Worker::changeSystem | ( | const shared_ptr< download::Progress > & | progress | ) |
Modifies the system to achieve the desired state set by setDesiredState.
progress |
void cupt::system::Worker::deleteArchive | ( | const string & | path | ) |
Deletes an archive file (it may be a symlink). Verifies that deleted file is located under archives path directory.
path | absolute (i.e., not relative) path to file |
Deletes all partially downloaded archive files.
shared_ptr< const ActionsPreview > cupt::system::Worker::getActionsPreview | ( | ) | const |
Shouldn't be called before setDesiredState.
vector< pair< string, shared_ptr< const BinaryVersion > > > cupt::system::Worker::getArchivesInfo | ( | ) | const |
gets available archives of binary versions
Gets paths of all '.deb' archives in the archives directory and matches them to available binary versions. Not matched paths with be paired with an empty pointer.
pair< size_t, size_t > cupt::system::Worker::getDownloadSizesPreview | ( | ) | const |
Shouldn't be called before setDesiredState.
map< string, ssize_t > cupt::system::Worker::getUnpackedSizesPreview | ( | ) | const |
Shouldn't be called before setDesiredState.
void cupt::system::Worker::removeSnapshot | ( | const Snapshots & | , |
const string & | name | ||
) |
Removes a system snapshot.
name | name of the snapshot |
void cupt::system::Worker::renameSnapshot | ( | const Snapshots & | , |
const string & | previousName, | ||
const string & | newName | ||
) |
Renames a system snapshot.
previousName | previous snasphot name |
newName | new snapshot name |
void cupt::system::Worker::saveSnapshot | ( | const Snapshots & | , |
const string & | name | ||
) |
Makes a system snapshot with a name name.
name | the snapshot name. |
void cupt::system::Worker::setAutomaticallyInstalledFlag | ( | const string & | packageName, |
bool | value | ||
) |
Marks a package as automatically or manually installed.
packageName | |
value | if true , marks as automatically installed, if false , marks as manually installed |
void cupt::system::Worker::setDesiredState | ( | const Resolver::Offer & | offer | ) |
Sets the desired system state.
May be called several times for examining different possible system states.
offer |
void cupt::system::Worker::setPackagePurgeFlag | ( | const string & | packageName, |
bool | value | ||
) |
Sets the purge flag for removed packages.
Removed packages can be either simply removed or removed along with their configuration files (purged).
This method should be called only after setDesiredState. If the new call to setDesiredState has been made, all the changes made previously by calling this method are reset and should be repeated if needed.
This method must not be called for packages which are not marked for removal or purge.
packageName | binary package name to modify a flag value for |
value | the target state of the flag |
void cupt::system::Worker::updateReleaseAndIndexData | ( | const shared_ptr< download::Progress > & | progress | ) |
Downloads latest Release and Packages/Sources files from repository sources.
progress |