Skip to content

Commit

Permalink
doc: add docs for provides
Browse files Browse the repository at this point in the history
  • Loading branch information
inknos committed Nov 30, 2023
1 parent 212aa06 commit 979d54c
Show file tree
Hide file tree
Showing 6 changed files with 73 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dnf5.spec
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Provides: dnf5-command(swap)
Provides: dnf5-command(mark)
Provides: dnf5-command(autoremove)
Provides: dnf5-command(check-upgrade)
Provides: dnf5-command(provides)

Provides: dnf5-command(leaves)
Provides: dnf5-command(repoquery)
Expand Down Expand Up @@ -272,6 +273,7 @@ It supports RPM packages, modulemd modules, and comps groups & environments.
%{_mandir}/man8/dnf5-mark.8.*
# TODO(jkolarik): module is not ready yet
# %%{_mandir}/man8/dnf5-module.8.*
%{_mandir}/man8/dnf5-provides.8.*
%{_mandir}/man8/dnf5-reinstall.8.*
%{_mandir}/man8/dnf5-remove.8.*
%{_mandir}/man8/dnf5-repo.8.*
Expand Down
1 change: 1 addition & 0 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ if(WITH_MAN)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/man/dnf5-mark.8 DESTINATION share/man/man8)
# TODO(jkolarik): module is not ready yet
# install(FILES ${CMAKE_CURRENT_BINARY_DIR}/man/dnf5-module.8 DESTINATION share/man/man8)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/man/dnf5-provides.8 DESTINATION share/man/man8)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/man/dnf5-reinstall.8 DESTINATION share/man/man8)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/man/dnf5-remove.8 DESTINATION share/man/man8)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/man/dnf5-repo.8 DESTINATION share/man/man8)
Expand Down
1 change: 1 addition & 0 deletions doc/commands/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ DNF5 Commands
leaves.8
makecache.8
mark.8
provides.8
reinstall.8
remove.8
repo.8
Expand Down
64 changes: 64 additions & 0 deletions doc/commands/provides.8.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
..
Copyright Contributors to the libdnf project.
This file is part of libdnf: https://github.com/rpm-software-management/libdnf/

Libdnf is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

Libdnf is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with libdnf. If not, see <https://www.gnu.org/licenses/>.

.. _provides_command_ref-label:

##################
Provides Command
##################

Synopsis
========

``dnf5 provides [global options] <package-spec>...``


Description
===========

The ``provides`` command in ``DNF5`` finds the packages providing the given ``<package-spec>``.
It can match specs by ``Provides`` or by filename.


Examples
========

``dnf5 provides tito``
| Outputs which packages provide the command ``tito``.

``dnf5 provides /usr/bin/tito``
| Outputs which package provides the file ``/usr/bin/tito``
``dnf5 provides zless``
| There is no ``Provides`` for zless but a package that contains ``zless`` exist.
| Outputs the package that provides the file ``/usr/bin/zless``
.. note::
New behavior: if one or more packages are not found by provides DNF5 will now return
exit code 1 and list all provides that do not match at the end of the output.


``dnf5 provides rpm nonexistent_package``
| Output provides for ``rpm`` and inform in ``stderr`` that ``nonexistent_package``
| did not match any result.
See Also
========

| :manpage:`dnf5-specs(7)`, :ref:`Patterns specification <specs_misc_ref-label>`
1 change: 1 addition & 0 deletions doc/conf.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ man_pages = [
('commands/makecache.8', 'dnf5-makecache', 'Makecache Command', AUTHORS, 8),
('commands/mark.8', 'dnf5-mark', ' Mark Command', AUTHORS, 8),
('commands/module.8', 'dnf5-module', ' Module Command', AUTHORS, 8),
('commands/provides.8', 'dnf5-provides', 'Provides Command', AUTHORS, 8),
('commands/reinstall.8', 'dnf5-reinstall', 'Reinstall Command', AUTHORS, 8),
('commands/remove.8', 'dnf5-remove', 'Remove Command', AUTHORS, 8),
('commands/repo.8', 'dnf5-repo', 'Repo Command', AUTHORS, 8),
Expand Down
4 changes: 4 additions & 0 deletions doc/dnf5.8.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,9 @@ For more details see the separate man page for the specific command, f.e. ``man
:ref:`mark <mark_command_ref-label>`
| Change the reason of an installed package.
:ref:`provides <provides_command_ref-label>`
| Find what package provides the given value.
:ref:`reinstall <reinstall_command_ref-label>`
| Reinstall packages.
Expand Down Expand Up @@ -358,6 +361,7 @@ Commands in detail:
| :manpage:`dnf5-leaves(8)`, :ref:`Leaves command <leaves_command_ref-label>`
| :manpage:`dnf5-makecache(8)`, :ref:`Makecache command <makecache_command_ref-label>`
| :manpage:`dnf5-mark(8)`, :ref:`Mark command <mark_command_ref-label>`
| :manpage:`dnf5-provides(8)`, :ref:`Provides command <provides_command_ref-label>`
| :manpage:`dnf5-reinstall(8)`, :ref:`Reinstall command <reinstall_command_ref-label>`
| :manpage:`dnf5-remove(8)`, :ref:`Remove command <remove_command_ref-label>`
| :manpage:`dnf5-repo(8)`, :ref:`Repo command <repo_command_ref-label>`
Expand Down

0 comments on commit 979d54c

Please sign in to comment.