libdnf5::offline

const std::string libdnf5::offline::REBOOT_REQUESTED_ID = {"9348174c5cc74001a71ef26bd79d302e"}
const std::string libdnf5::offline::OFFLINE_STARTED_ID = {"3e0a5636d16b4ca4bbe5321d06c6aa62"}
const std::string libdnf5::offline::OFFLINE_FINISHED_ID = {"8cec00a1566f4d3594f116450395f06c"}
const std::string libdnf5::offline::STATUS_DOWNLOAD_INCOMPLETE = {"download-incomplete"}
const std::string libdnf5::offline::STATUS_DOWNLOAD_COMPLETE = {"download-complete"}
const std::string libdnf5::offline::STATUS_READY = {"ready"}
const std::string libdnf5::offline::STATUS_TRANSACTION_INCOMPLETE = {"transaction-incomplete"}
const std::filesystem::path libdnf5::offline::MAGIC_SYMLINK = {"/system-update"}
const std::filesystem::path libdnf5::offline::DEFAULT_DATADIR = {std::filesystem::path(libdnf5::SYSTEM_STATE_DIR) / "offline"}
const std::filesystem::path libdnf5::offline::TRANSACTION_STATE_FILENAME = {"offline-transaction-state.toml"}
class OfflineTransactionState
#include <offline.hpp>

Class to handle offline transaction state.

Public Functions

OfflineTransactionState() = delete
~OfflineTransactionState()
OfflineTransactionState(std::filesystem::path path)

Constructs a new OfflineTransactionState instance based on the state file location.

Parameters:

path – Path to the state file (default location is /usr/lib/sysimage/libdnf5/offline/offline-transaction-state.toml).

OfflineTransactionState(const OfflineTransactionState &src)
OfflineTransactionState &operator=(const OfflineTransactionState &src)
OfflineTransactionState(OfflineTransactionState &&src) noexcept
OfflineTransactionState &operator=(OfflineTransactionState &&src) noexcept
OfflineTransactionStateData &get_data()

Returns offline transaction state data.

void write()

Write the current state to the file.

const std::exception_ptr &get_read_exception() const

Returns any exception caught during the reading of the state file (or nullptr if no exception occurred).

std::filesystem::path get_path() const

Returns path to the state file.

struct OfflineTransactionStateData
#include <offline.hpp>

Data of the initiated offline transaction state, by default stored in the /usr/lib/sysimage/libdnf5/offline/offline-transaction-state.toml file.

Public Functions

OfflineTransactionStateData()
~OfflineTransactionStateData()
OfflineTransactionStateData(const OfflineTransactionStateData &src)
OfflineTransactionStateData &operator=(const OfflineTransactionStateData &src)
OfflineTransactionStateData(OfflineTransactionStateData &&src) noexcept
OfflineTransactionStateData &operator=(OfflineTransactionStateData &&src) noexcept
void set_state_version(int state_version)

Set the transaction state data file version.

int get_state_version() const
void set_status(const std::string &status)

Set current offline transaction status. One of download-incomplete, download-complete, ready, or transaction-incomplete.

const std::string &get_status() const
void set_cachedir(const std::string &cachedir)

Set the cachedir to be used for the offline transaction.

const std::string &get_cachedir() const
void set_target_releasever(const std::string &target_releasever)

Set the target releasever for the offline transaction.

const std::string &get_target_releasever() const
void set_system_releasever(const std::string &system_releasever)

Set the detected releasever in time the offline transaction was initialized.

const std::string &get_system_releasever() const
void set_verb(const std::string &verb)

Set the dnf command used to initialize the offline transaction (e.g. “system-upgrade download”).

const std::string &get_verb() const
void set_cmd_line(const std::string &cmd_line)

Set the command line used to initialize the offline transaction.

const std::string &get_cmd_line() const
void set_poweroff_after(bool poweroff_after)

Set whether the system power off after the operation is complete is required.

bool get_poweroff_after() const
void set_module_platform_id(const std::string &module_platform_id)

Set module_platform_id for the offline transaction.

const std::string &get_module_platform_id() const

Public Members

friend OfflineTransactionState