libdnf5::comps
-
enum class libdnf5::comps::PackageType : int
Values:
-
enumerator CONDITIONAL
-
enumerator DEFAULT
-
enumerator MANDATORY
-
enumerator OPTIONAL
-
enumerator CONDITIONAL
-
using libdnf5::comps::CompsSackWeakPtr = WeakPtr<CompsSack, false>
-
inline bool libdnf5::comps::environment_display_order_cmp(Environment a, Environment b)
-
inline bool libdnf5::comps::group_display_order_cmp(Group a, Group b)
-
inline PackageType libdnf5::comps::operator|(PackageType a, PackageType b)
-
inline PackageType libdnf5::comps::operator|=(PackageType &a, PackageType b)
-
inline constexpr PackageType libdnf5::comps::operator&(PackageType a, PackageType b)
-
inline constexpr bool libdnf5::comps::any(PackageType flags)
- LIBDNF_API PackageType libdnf5::comps::package_type_from_string (const std::string &type)
- LIBDNF_API PackageType libdnf5::comps::package_type_from_string (const std::vector< std::string > types)
- LIBDNF_API std::string libdnf5::comps::package_type_to_string (const PackageType type)
- LIBDNF_API std::vector< std::string > libdnf5::comps::package_types_to_strings (const PackageType types)
-
class CompsSack
Public Functions
-
explicit CompsSack(const libdnf5::BaseWeakPtr &base)
-
explicit CompsSack(libdnf5::Base &base)
-
~CompsSack()
-
CompsSackWeakPtr get_weak_ptr()
- Since
5.2.12.1
-
libdnf5::BaseWeakPtr get_base() const
- Since
5.2.12.1
- Returns:
The
Base
object to which this object belongs.
-
void load_config_excludes()
Loads excluded comps from the configuration. Uses the
disable_excludes
,excludegroups
andexcludeenvironments
configuration options for calculation.- Since
5.2.12.1
-
const std::set<std::string> get_config_environment_excludes()
Returns config excluded environments
- Since
5.2.12.1
-
const std::set<std::string> get_config_group_excludes()
Returns config excluded groups
- Since
5.2.12.1
-
const std::set<std::string> get_user_environment_excludes()
Returns user excluded environments
- Since
5.2.12.1
-
void add_user_environment_excludes(const EnvironmentQuery &excludes)
Add environments to user excluded environments
- Since
5.2.12.1
- Parameters:
excludes – environments to add to excludes
-
void remove_user_environment_excludes(const EnvironmentQuery &excludes)
Remove environments from user excluded environments
- Since
5.2.12.1
- Parameters:
excludes – environments to remove from excludes
-
void set_user_environment_excludes(const EnvironmentQuery &excludes)
Resets user excluded environments to a new value
- Since
5.2.12.1
- Parameters:
excludes – environments to exclude
-
void clear_user_environment_excludes()
Clear user excluded environments
- Since
5.2.12.1
-
const std::set<std::string> get_user_group_excludes()
Returns user excluded groups
- Since
5.2.12.1
-
void add_user_group_excludes(const GroupQuery &excludes)
Add groups to user excluded groups
- Since
5.2.12.1
- Parameters:
excludes – groups to add to excludes
-
void remove_user_group_excludes(const GroupQuery &excludes)
Remove groups from user excluded groups
- Since
5.2.12.1
- Parameters:
excludes – groups to remove from excludes
-
void set_user_group_excludes(const GroupQuery &excludes)
Resets user excluded groups to a new value
- Since
5.2.12.1
- Parameters:
excludes – groups to exclude
-
void clear_user_group_excludes()
Clear user excluded groups
- Since
5.2.12.1
-
explicit CompsSack(const libdnf5::BaseWeakPtr &base)
-
class Environment
Public Functions
-
~Environment()
-
Environment(const Environment &src)
-
Environment &operator=(const Environment &src)
-
Environment(Environment &&src) noexcept
-
Environment &operator=(Environment &&src) noexcept
-
std::string get_environmentid() const
- Since
5.0
- Returns:
The Environment id.
-
std::string get_name() const
- Since
5.0
- Returns:
The Environment name.
-
std::string get_description() const
- Since
5.0
- Returns:
The Environment description.
-
std::string get_translated_name(const char *lang) const
- Since
5.0
- Returns:
The translated name of the Environment based on current locales. If no translation is found, return untranslated name.
-
std::string get_translated_name() const
-
std::string get_translated_description(const char *lang) const
- Since
5.0
- Returns:
The translated description of the Environment based on current locales. If no translation is found, return untranslated description.
-
std::string get_translated_description() const
-
std::string get_order() const
- Since
5.0
- Returns:
The Environment display order.
-
int get_order_int() const
- Since
5.2.12.1
- Returns:
The Environment display order as an integer or INT_MAX if the order is invalid.
-
std::vector<std::string> get_groups()
- Since
5.0
- Returns:
std::vector of Group ids belonging to the Environment.
-
std::vector<std::string> get_optional_groups()
- Since
5.0
- Returns:
std::vector of optional Group ids belonging to the Environment.
-
std::set<std::string> get_repos() const
- Since
5.0
- Returns:
std::set of names of repositories that contain the Environment.
-
bool get_installed() const
- Since
5.0
- Returns:
true
if the Environment is installed (belongs to the @System repo).
-
libdnf5::transaction::TransactionItemReason get_reason() const
- Since
5.0
- Returns:
Resolved reason why the Environment was installed. Environments can be installed due to multiple reasons, only the most significant is returned.
-
Environment &operator+=(const Environment &rhs)
Merge the Environment with another one.
- Since
5.0
-
bool operator==(const Environment &rhs) const noexcept
-
bool operator!=(const Environment &rhs) const noexcept
-
bool operator<(const Environment &rhs) const
-
void serialize(const std::string &path)
Serialize the Environment into an xml file
- Since
5.0
- Parameters:
path – Path of the output xml file.
- Throws:
utils::xml::XMLSaveError – When saving of the file fails.
-
~Environment()
-
struct EnvironmentId
Public Functions
-
EnvironmentId() = default
-
inline explicit EnvironmentId(int id)
-
inline bool operator==(const EnvironmentId &other) const noexcept
-
inline bool operator!=(const EnvironmentId &other) const noexcept
Public Members
-
int id = {0}
-
EnvironmentId() = default
-
class EnvironmentQuery : public libdnf5::sack::Query<Environment>
Public Types
-
using ExcludeFlags = libdnf5::sack::ExcludeFlags
Public Functions
-
explicit EnvironmentQuery(const libdnf5::BaseWeakPtr &base, bool empty = false)
-
explicit EnvironmentQuery(libdnf5::Base &base, bool empty = false)
-
explicit EnvironmentQuery(const libdnf5::BaseWeakPtr &base, ExcludeFlags flags, bool empty = false)
-
explicit EnvironmentQuery(libdnf5::Base &base, ExcludeFlags flags, bool empty = false)
-
~EnvironmentQuery()
-
EnvironmentQuery(const EnvironmentQuery &src)
-
EnvironmentQuery &operator=(const EnvironmentQuery &src)
-
EnvironmentQuery(EnvironmentQuery &&src) noexcept
-
EnvironmentQuery &operator=(EnvironmentQuery &&src) noexcept
-
void filter_environmentid(const std::string &pattern, sack::QueryCmp cmp = libdnf5::sack::QueryCmp::EQ)
-
void filter_environmentid(const std::vector<std::string> &patterns, sack::QueryCmp cmp = libdnf5::sack::QueryCmp::EQ)
-
void filter_name(const std::string &pattern, sack::QueryCmp cmp = libdnf5::sack::QueryCmp::EQ)
-
void filter_name(const std::vector<std::string> &patterns, sack::QueryCmp cmp = libdnf5::sack::QueryCmp::EQ)
-
void filter_installed(bool value)
-
using ExcludeFlags = libdnf5::sack::ExcludeFlags
-
class Group
Public Functions
-
~Group()
-
std::string get_translated_name(const char *lang) const
- Since
5.0
- Returns:
The translated name of the Group based on current locales. If no translation is found, return untranslated name.
-
std::string get_translated_name() const
-
std::string get_translated_description(const char *lang) const
- Since
5.0
- Returns:
The translated description of the Group based on current locales. If no translation is found, return untranslated ui_description.
-
std::string get_translated_description() const
-
int get_order_int() const
- Since
5.2.12.1
- Returns:
The Group display order as an integer or INT_MAX if the order is invalid.
-
std::vector<Package> get_packages()
- Since
5.0
- Returns:
std::vector of Packages belonging to the Group.
-
std::vector<Package> get_packages_of_type(PackageType type)
- Since
5.0
- Parameters:
type – One of the PackageTypes.
- Returns:
std::vector of Packages of given type belonging to the Group.
-
std::set<std::string> get_repos() const
- Since
5.0
- Returns:
std::set of names of repositories that contain the Group.
-
bool get_installed() const
- Since
5.0
- Returns:
true
if the Group is installed (belongs to the @System repo).
-
~Group()
-
class GroupQuery : public libdnf5::sack::Query<Group>
Public Types
-
using ExcludeFlags = libdnf5::sack::ExcludeFlags
Public Functions
-
explicit GroupQuery(const libdnf5::BaseWeakPtr &base, bool empty = false)
-
explicit GroupQuery(libdnf5::Base &base, bool empty = false)
-
explicit GroupQuery(const libdnf5::BaseWeakPtr &base, ExcludeFlags flags, bool empty = false)
-
explicit GroupQuery(libdnf5::Base &base, ExcludeFlags flags, bool empty = false)
-
~GroupQuery()
-
GroupQuery(const GroupQuery &src)
-
GroupQuery &operator=(const GroupQuery &src)
-
GroupQuery(GroupQuery &&src) noexcept
-
GroupQuery &operator=(GroupQuery &&src) noexcept
-
void filter_groupid(const std::string &pattern, sack::QueryCmp cmp = libdnf5::sack::QueryCmp::EQ)
-
void filter_groupid(const std::vector<std::string> &patterns, sack::QueryCmp cmp = libdnf5::sack::QueryCmp::EQ)
-
void filter_name(const std::string &pattern, sack::QueryCmp cmp = libdnf5::sack::QueryCmp::EQ)
-
void filter_package_name(const std::vector<std::string> &patterns, sack::QueryCmp cmp = libdnf5::sack::QueryCmp::EQ)
Filter groups by packages they contain. Keep only groups that contain packages with given names.
- Since
5.12
- Parameters:
patterns – A vector of strings (package names) the filter is matched against.
cmp_type – A comparison (match) operator, defaults to
QueryCmp::EQ
.
-
void filter_name(const std::vector<std::string> &patterns, sack::QueryCmp cmp = libdnf5::sack::QueryCmp::EQ)
-
void filter_uservisible(bool value)
-
void filter_default(bool value)
-
void filter_installed(bool value)
-
using ExcludeFlags = libdnf5::sack::ExcludeFlags
-
class InvalidPackageType : public libdnf5::Error
Public Functions
-
InvalidPackageType(const std::string &type)
-
InvalidPackageType(const PackageType type)
-
inline virtual const char *get_domain_name() const noexcept override
- Returns:
The domain name (namespace and enclosing class names) of the exception.
-
inline virtual const char *get_name() const noexcept override
- Returns:
The exception class name.
-
InvalidPackageType(const std::string &type)
-
class Package
Public Functions
-
Package(const std::string &name, PackageType type, const std::string &condition)
-
~Package()
-
void set_name(const std::string &value)
-
PackageType get_type() const
- Since
5.0
- Returns:
The PackageType.
-
void set_type(const PackageType &value)
-
std::string get_type_string() const
- Since
5.0
- Returns:
std::string that corresponds to the PackageType.
-
std::string get_condition() const
- Since
5.0
- Returns:
The condition (name of package) under which the package gets installed.
-
void set_condition(const std::string &value)
-
Package(const std::string &name, PackageType type, const std::string &condition)