New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[context,API] Functions for accessing configuration options #1109
[context,API] Functions for accessing configuration options #1109
Conversation
Congratulations! One of the builds has completed. 🍾 You can install the built RPMs by following these steps:
Please note that the RPMs should be used only in a testing environment. |
@@ -107,6 +107,7 @@ typedef enum { | |||
DNF_ERROR_CANNOT_WRITE_CACHE, /* Since: 0.7.0 */ | |||
DNF_ERROR_NO_CAPABILITY, /* Since: 0.7.0 */ | |||
DNF_ERROR_REMOVAL_OF_PROTECTED_PKG, /* Since: 0.7.0 */ | |||
DNF_ERROR_UNKNOWN_OPTION, /* Since: 0.56.0 */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docstring needs to be updated for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added docstring for the new error code.
To be honest, I don't like this enum. Old explicitly assigned numbers look chaotic. And DNF_ERROR_LAST equals 55 (54 before), but DNF_ERROR_UNFINISHED_TRANSACTION equals 66. It look messy.
And we must be careful that the newly added error codes do not conflict with the existing explicitly defined ones.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with you on this, and this is something we should fix for libdnf v5.
c56f382
to
4d2262e
Compare
In fact, it is a C wrapper for libdnf::OptionBinds::Item class methods getPriority(), getValueString(), newString(). Added: gchar *dnf_conf_main_get_option(const gchar *name, enum DnfConfPriority *priority, GError ** error); gboolean dnf_conf_main_set_option(const gchar *name, enum DnfConfPriority priority, const gchar *value, GError ** error);
Sets the option value and priority. Supports also repositories options. Repository(ies) can be specified with globs. Added: gboolean dnf_conf_add_setopt(const gchar * key, enum DnfConfPriority priority, const gchar * value, GError ** error); key is option_name or repository_id.option_name
4d2262e
to
3120686
Compare
📌 Commit 3120686 has been approved by |
Sets the option value and priority. Supports also repositories options. Repository(ies) can be specified with globs. Added: gboolean dnf_conf_add_setopt(const gchar * key, enum DnfConfPriority priority, const gchar * value, GError ** error); key is option_name or repository_id.option_name Closes: #1109 Approved by: Conan-Kudo
Closes: #1109 Approved by: Conan-Kudo
☀️ Test successful - status-papr |
libdnf::OptionBinds::Item
class methodsgetPriority()
,getValueString()
,newString()
.dnf_conf_add_setopt
for adding setopt.Added: