Skip to content
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

Dnf5/feature/config #918

Closed

Conversation

jrohel
Copy link
Contributor

@jrohel jrohel commented Mar 20, 2020

No description provided.

@jrohel jrohel force-pushed the dnf5/feature/config branch 2 times, most recently from 0c420ca to bfddb71 Compare March 22, 2020 15:29
Copy link
Member

@Conan-Kudo Conan-Kudo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks like a good start, but there are a few things I feel should be addressed...

OptionStringList & protected_packages();
OptionString & username();
OptionString & password();
OptionBool & gpgcheck();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we go ahead and lay the groundwork here for the GPG check refactor? (As noted in RhBug:1433592#c7). This is the perfect time to do so.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Conan-Kudo Am I correct that this is a request to drop RHEL7, RHEL8 compatibility in favour of Zypper behaviour?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somewhat. The gpgcheck_policy option would control whether we behave as YUM does or as Zypper does for gpgcheck. In general, I think the correct default is to behave like Zypper here, but I'm okay with making the default the same as YUM, as long as we can tune this.

OptionPath & destdir();
OptionString & comment();
OptionBool & downloadonly();
OptionBool & ignorearch();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's go ahead and add the sticky vendor options that are part of #907.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to first finish review of #907.
We would like to develop dnf5 into state of libdnf master, then we will backport all additional patches from dnf-4

constexpr const char * PERSISTDIR = "/var/lib/dnf";
constexpr const char * SYSTEM_CACHEDIR = "/var/cache/dnf";

constexpr const char * CONF_FILENAME = "/etc/dnf/dnf.conf";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is the /etc/dnf/conf.d setup?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for comments. I wrote notes. The code is under development. I'm trying to reuse old code and adopt it to libdnf5.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why '/etc/dnf/conf.d' ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's what's in the dnf PR: rpm-software-management/dnf#1414

@jrohel jrohel force-pushed the dnf5/feature/config branch 4 times, most recently from 36efaec to deb378e Compare March 24, 2020 08:57
virtual const char * get_domain_name() const noexcept { return "libdnf"; }
virtual const char * get_name() const noexcept { return "Exception"; }
virtual const char * get_description() const noexcept { return ""; }
};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shell we extend all errors by error code value?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Example:
An Exception with error code bad_value can be replaced by inherited specialized exception BadValue.

I thought about adding error code for easy transform to other languages eg C. The same approach as get_name() -> Each exception class will have unique id (error code). But how create well defined unique id? The string get_domain_name() + get_name() is unique to each exception now.

Note:
There is error_code in my SystemError exception class. Because system error codes are defined and I think that is no need to create specialized exception for each system error code.
I have some concept but it can be modified.

@jrohel jrohel force-pushed the dnf5/feature/config branch 7 times, most recently from 608f883 to 86e93f6 Compare March 30, 2020 08:17
void swap_logger(std::unique_ptr<Logger> & logger, size_t index);
Swaps the logger at the "index" position with another "logger".

It is used, for example, to replace a temporary (memory buffer) logger
with a final one.
Formatting library for C++.
Safe printf implementation including the POSIX extension for positional
arguments and implementation of C++20 std::format.

Idea:
If we only use C++20 style (std::format) in libdnf then the fmt library
will only be needed for compilers without C++20 support.
Abstract class. Base class for all configuration options type.
Uses a new exception hierarchy, snake_case, ...
The type of option is taken from linked option during compile type.
It uses topical default value and parameters from linked option during
runtime.
OptionBool, OptionNumber, OptionString
option that represents a time duration
Support for text translation
Type safe printf() replacement
error: conversion from ‘long unsigned int’ to ‘int’ may change value [-Werror=conversion]
 1017 | detail::FormatListN<sizeof...(Args)> makeFormatList(const Args&... args)
We don't want to depend on GLib, but librepo and libmodulemd use it
in  API.
WeakPtr is a "smart" pointer. It contains a pointer to resource and to
guard of resource. WeakPtr pointer can be owner of the resource. However,
the resource itself may depend on another resource.
WeakPtr registers/unregisters itself at the guard of resource. And
the resource guard invalidates the registered WeakPtrs when the resource
is unusable (eg. its dependecny was released).
@rh-atomic-bot
Copy link

☔ The latest upstream changes (presumably 188cdbc) made this pull request unmergeable. Please resolve the merge conflicts.

@jrohel jrohel closed this Jul 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants