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] Implement new argument "--dump-variables" #875

Merged
merged 3 commits into from
Sep 22, 2023

Conversation

jrohel
Copy link
Contributor

@jrohel jrohel commented Sep 6, 2023

If dnf5 is run with this argument, variable values are added to standard output.

The old DNF4 supports this argument only with the config-manager plugin. If the user wants to know the values of the variables with which a certain command will run, he must first use config-manager and then run the desired command with the same settings (same environment and configuration files) and hope that nothing changed in between (e.g. thanks to a plugin).

In other words, this PR implements part of the functionality of the dnf4 config-manager plugin, but for general use.

Related to: #405

@m-blaha
Copy link
Member

m-blaha commented Sep 6, 2023

Just an idea - would it make sense to implement this as a new command (e.g. dnf5 debug)? It could present to the user more information - variables, all applied config options (since configuration is spread among multiple files, this might be interesting), versions of libraries in use (libdnf5, libsolv, librpm, librepo...) and so on.

Copr plugin has the same subcommand used for similar purpose.

@jrohel jrohel force-pushed the dnf5/dump_variables branch 3 times, most recently from 506956b to cde51fb Compare September 7, 2023 09:56
If dnf5 is run with this argument, variable values are added to standard
output.

The old DNF4 supports this argument only with the `config-manager` plugin.
If the user wants to know the values of the variables with which a certain
command will run, he must first use `config-manager` and then run
the desired command with the same settings (same environment and
configuration files) and hope that nothing changed in between
(e.g. thanks to a plugin).

This implements part of the functionality of the dnf4 config-manager plugin,
but for general use.
@jrohel
Copy link
Contributor Author

jrohel commented Sep 20, 2023

Rebased to resolve conflicts.

@ppisar
Copy link
Contributor

ppisar commented Sep 20, 2023

There is missing a documentation in doc/dnf5.8.rst.

@ppisar
Copy link
Contributor

ppisar commented Sep 20, 2023

I somehow find it quite obtrusive that "./dnf5/dnf5 --dump-variables" does not work also alone:

$ ./dnf5/dnf5 --dump-variables
Missing command. Add "--help" for more information about the arguments.

But maybe that's on purpose.

@ppisar ppisar self-requested a review September 20, 2023 10:59
@jrohel
Copy link
Contributor Author

jrohel commented Sep 20, 2023

@ppisar
I intended that --dump-variables would print out what variables the given command was running with.
I am considering whether to modify the behavior of dnf5.

Edit:
I added a commit that allows running dnf5 with the --dump-variables argument without the command.

Copy link
Contributor

@ppisar ppisar left a comment

Choose a reason for hiding this comment

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

Documentation and standalone invocation works now.

dnf5/main.cpp Show resolved Hide resolved
dnf5/main.cpp Show resolved Hide resolved
dnf5/main.cpp Show resolved Hide resolved
dnf5/main.cpp Show resolved Hide resolved
@ppisar ppisar added this pull request to the merge queue Sep 22, 2023
Merged via the queue into rpm-software-management:main with commit 20a2a69 Sep 22, 2023
5 of 6 checks passed
@jrohel jrohel linked an issue Oct 3, 2023 that may be closed by this pull request
3 tasks
@jrohel jrohel mentioned this pull request Nov 7, 2023
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

DNF config-manager Plugin
4 participants