-
Notifications
You must be signed in to change notification settings - Fork 125
Lock from the time system repository is loaded until exit #2519
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
base: main
Are you sure you want to change the base?
Changes from all commits
07a4538
a9f45be
f9a83ca
f2963ed
e50d691
b0f91a6
b656e39
2dcab1f
d58064f
bf450de
93ab1d9
c0b97b3
84fdf67
1417490
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -77,7 +77,7 @@ class DNF_API Context : public libdnf5::cli::session::Session { | |
| const std::vector<std::string> & cves); | ||
|
|
||
| /// Sets callbacks for repositories and loads them, updating metadata if necessary. | ||
| void load_repos(bool load_system); | ||
| void load_repos(bool load_system, bool load_available); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. While we are doing changes here, I am wondering whether the This would need a private header for
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree, it could be made private. |
||
|
|
||
| void store_offline(libdnf5::base::Transaction & transaction); | ||
|
|
||
|
|
@@ -133,6 +133,9 @@ class DNF_API Context : public libdnf5::cli::session::Session { | |
| void set_load_system_repo(bool on); | ||
| bool get_load_system_repo() const noexcept; | ||
|
|
||
| void set_will_modify_system(bool will_modify_system); | ||
| bool get_will_modify_system() const noexcept; | ||
|
|
||
| void set_load_available_repos(LoadAvailableRepos which); | ||
| LoadAvailableRepos get_load_available_repos() const noexcept; | ||
|
|
||
|
|
||
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.
If I understand correctly this value is derived from (it duplicates) information already present in the
Context. Is there a plan to use it somehow differently later on?Currently I would rather make
cmd_requires_privileges(dnf5::Context context)a private method ofContextand use it directly. It would require introducing a private header file forContext, where we would likely moveContext::Impl, but I think that would be a good move regardless.What do you think?
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.
It may be useful in the future for commands (especially those provided by plugins) to declare for themselves whether they will modify the system rather than doing the heuristics in
cmd_requires_privileges. Also if we ever do something about https://issues.redhat.com/browse/RHEL-67915, there would be a distinction between "will modify the system repository" (inside the installroot) and "needs root privileges".But for now your suggestion is maybe better, like you said, a
context_private.hppwould be a good idea.