-
Notifications
You must be signed in to change notification settings - Fork 91
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
Versionlock functionality for dnf5 #1121
Conversation
252bbe3
to
c14e9fd
Compare
0cf31c9
to
b436ca5
Compare
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 did an initial review and plan to revisit it, likely tomorrow, to perform testing on the commands.
@@ -28,6 +28,7 @@ along with libdnf. If not, see <https://www.gnu.org/licenses/>. | |||
#include "libdnf5/base/base_weak.hpp" | |||
#include "libdnf5/common/exception.hpp" | |||
#include "libdnf5/common/weak_ptr.hpp" | |||
#include "libdnf5/rpm/versionlock_config.hpp" |
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.
Or just #include "versionlock_config.hpp"
on L27 as others from the same folder.
I'd consider adding the docs for manual editing of the toml config file or track it as the follow-up issue. This commit message is a good start. |
I've needed to patch the |
@jan-kolarik I've resolved most of you comments. To simplify the review process I added the changes as new commits. But I can squash them after the review if you want me to. |
Config file for versionlock excludes is a TOML file with following structure: ----------------------- version = "1.0" [[packages]] name = "bash" # name of the package [[packages.conditions]] key = "evr" # epoch, version, evr, and arch keys are supported comparator = "=" # <, <=, =, >=, >, and != operators are supported value = "0:5.2.15-5.fc39" # pattern to match -------------------------------- Each package can contain multiple `conditions` tables. In such case all the conditions must be true for a package to match. This allows for example instructing versionlock to keep a package on given major version. This example will keep acpi package on major version 2: [[packages]] name = "acpi" [[packages.conditions]] key = "version" comparator = ">=" value = "2" [[packages.conditions]] key = "version" comparator = "<" value = "3" To exclude any particular package version from getting installed just use != comparator (meaning you want to lock to any version different from the given one). This example will exclude acpi-1.2-3.fc39 package: [[packages]] name = "acpi" [[packages.conditions]] key = "evr" comparator = "!=" value = "1.2-3.fc39"
Needed to support "exclude" functionality of the versionlock.
92aa0a4
to
44f92e6
Compare
The default path is now [installroot]/etc/dnf/versionlock.toml. If needed, we can add a config option for the path later.
This command is designed for maintaining versionlock configuration file. It supports following subcommands: - list: list the current configuration - add <pkg_spec>: add new entry for the given pkg_spec - exclude <pkg_spec>: add new exclude entry for the given pkg_spec - delete <pkg_spec>: remove any versionlock entries for pkg_spec - clear: remove all entries from the configuration
- Since the add and delete subcommands do not modify any rules but merely add or delete a rule, we can detect changes in the ruleset simply by comparing the size of the vector before and after the operation. - Simplify exclude implementation leveraging std::any_of
44f92e6
to
f33d4fc
Compare
LGTM, I believe if there is no other complaint or request, we can prepare the since tags to |
Cool, thanks. I'm gonna add a new commit with |
Replacement of dnf4 versionlock plugin.
The config file format changed from ambiguous plain text with globs to TOML format.
PR contains also commands for config file manipulation (dnf5 versionlock add/exclude/delete/clear). More sophisticated manipulations (e.g. "lock to major version 5", "lock to epoch 1") are currently not supported from commandline - the user needs to edit the config file manually to achieve this.
since
fields to 5.1.13 for new API methods before the mergingAdjustments of current CI tests: rpm-software-management/ci-dnf-stack#1434
Closes: #332.