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

doc: Revise packages filtering doc section #1632

Merged
merged 2 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions dnf5.spec
Original file line number Diff line number Diff line change
Expand Up @@ -330,12 +330,10 @@ It supports RPM packages, modulemd modules, and comps groups & environments.
%{_mandir}/man7/dnf*-aliases.7.*
%{_mandir}/man7/dnf*-caching.7.*
%{_mandir}/man7/dnf*-comps.7.*
# TODO(jkolarik): filtering is not ready yet
# %%{_mandir}/man7/dnf*-filtering.7.*
%{_mandir}/man7/dnf*-filtering.7.*
%{_mandir}/man7/dnf*-forcearch.7.*
%{_mandir}/man7/dnf*-installroot.7.*
# TODO(jkolarik): modularity is not ready yet
# %%{_mandir}/man7/dnf*-modularity.7.*
%%{_mandir}/man7/dnf*-modularity.7.*
%{_mandir}/man7/dnf*-specs.7.*
%{_mandir}/man5/dnf*.conf.5.*
%{_mandir}/man5/dnf*.conf-todo.5.*
Expand Down
6 changes: 2 additions & 4 deletions doc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,10 @@ if(WITH_MAN)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/man/dnf5-aliases.7 DESTINATION share/man/man7)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/man/dnf5-caching.7 DESTINATION share/man/man7)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/man/dnf5-comps.7 DESTINATION share/man/man7)
# TODO(jkolarik): filtering is not ready yet
# install(FILES ${CMAKE_CURRENT_BINARY_DIR}/man/dnf5-filtering.7 DESTINATION share/man/man7)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/man/dnf5-filtering.7 DESTINATION share/man/man7)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/man/dnf5-forcearch.7 DESTINATION share/man/man7)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/man/dnf5-installroot.7 DESTINATION share/man/man7)
# TODO(jkolarik): modularity is not ready yet
# install(FILES ${CMAKE_CURRENT_BINARY_DIR}/man/dnf5-modularity.7 DESTINATION share/man/man7)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/man/dnf5-modularity.7 DESTINATION share/man/man7)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/man/dnf5-specs.7 DESTINATION share/man/man7)

# plugin commands
Expand Down
1 change: 1 addition & 0 deletions doc/api/c++/libdnf5_rpm_package_sack.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
PackageSack
===========

.. _api_packagesack-label:

.. doxygenclass:: libdnf5::rpm::PackageSack
:members:
4 changes: 2 additions & 2 deletions doc/conf.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,10 @@ man_pages = [
('misc/aliases.7', 'dnf5-aliases', 'Aliases for command line arguments', AUTHORS, 7),
('misc/caching.7', 'dnf5-caching', 'Caching', AUTHORS, 7),
('misc/comps.7', 'dnf5-comps', 'Comps Groups And Environments', AUTHORS, 7),
# TODO(jkolarik): ('misc/filtering.7', 'dnf5-filtering', 'Packages Filtering', AUTHORS, 7),
('misc/filtering.7', 'dnf5-filtering', 'Packages Filtering', AUTHORS, 7),
('misc/forcearch.7', 'dnf5-forcearch', 'Forcearch Parameter', AUTHORS, 7),
('misc/installroot.7', 'dnf5-installroot', 'Installroot Parameter', AUTHORS, 7),
# TODO(jkolarik): ('misc/modularity.7', 'dnf5-modularity', 'Modularity Overview', AUTHORS, 7),
('misc/modularity.7', 'dnf5-modularity', 'Modularity Overview', AUTHORS, 7),
('misc/specs.7', 'dnf5-specs', 'Patterns Specification', AUTHORS, 7),
('dnf_daemon/dnf5daemon_client.8', 'dnf5daemon-client', 'Command-line interface for Dnf5daemon', AUTHORS, 8),
('dnf_daemon/dnf5daemon_server.8', 'dnf5daemon-server', 'Package management service with a DBus interface', AUTHORS, 8),
Expand Down
4 changes: 0 additions & 4 deletions doc/dnf5.conf-todo.5.rst
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,6 @@ This section does not track any deprecated option. For such options see :ref:`De

``config_file_age``

.. _disable_excludes_options-label:

``disable_excludes``

.. _allow_downgrade_options-label:

``allow_downgrade``
Expand Down
12 changes: 8 additions & 4 deletions doc/dnf5.conf.5.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
You should have received a copy of the GNU General Public License
along with libdnf. If not, see <https://www.gnu.org/licenses/>.

.. TODO(jkolarik): Fix --disableexcludes references, the option is dropped now.

.. _dnf5_conf-label:

##############################
Expand Down Expand Up @@ -741,6 +739,12 @@ configuration.

Default: ``75``

.. _disable_excludes_options-label:
``disable_excludes``
:ref:`list <list-label>`

Used to disable packages filtering. It can include a list of repository IDs (globs allowed) for which repository-specific excludes are ignored. If it contains the special value ``main``, excludes from the main configuration files are bypassed. If it contains the special value ``*``, no excludes filtering is applied at all.

.. _enablegroups_options-label:

``enablegroups``
Expand All @@ -758,7 +762,7 @@ configuration.
Exclude packages of this repository, specified by a name or a glob and
separated by a comma, from all operations.

Can be disabled using ``--disableexcludes`` command line switch.
Can be disabled using ``disable_excludes`` config option.

Default: ``[]``.

Expand Down Expand Up @@ -788,7 +792,7 @@ configuration.
so if you 'excludepkgs=*.i386' and 'includepkgs=python*' then only packages starting with python
that do not have an i386 arch will be seen by DNF5 in this repo.

Can be disabled using ``--disableexcludes`` command line switch.
Can be disabled using ``disable_excludes`` config option.

Default: ``[]``.

Expand Down
62 changes: 33 additions & 29 deletions doc/misc/filtering.7.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@
You should have received a copy of the GNU General Public License
along with libdnf. If not, see <https://www.gnu.org/licenses/>.

..
# TODO(jkolarik): review, fix according to DNF5 state

.. _filtering_misc_ref-label:

###################
Expand All @@ -28,42 +25,49 @@
Description
===========

Package filtering filters packages out from the available package set, making them invisible to most
of the ``DNF5`` commands. They cannot be used in a transaction. Packages can be filtered out by either
`Exclude Filtering` or `Modular Filtering`.
Package filtering removes packages from the available package set, making them invisible to most ``DNF5`` commands. As a result, these packages cannot be included in any transaction.

There are several ways a package can be filtered out:

Exclude Filtering
=================
Global excludes filtering
=========================

Exclude Filtering is a mechanism used by a user or by the ``DNF5`` plugin to modify the set of available
packages. Exclude Filtering can be modified by either ``includepkgs`` or ``excludepkgs`` configuration options in
configuration files. In addition to user-configured excludes, plugins can also extend the set of excluded packages.
To disable excludes from the ``DNF5`` plugin you can use the ``--disable-plugin`` command line option.
Exclude filtering can be adjusted using the ``includepkgs`` or ``excludepkgs`` configuration options in the DNF5 configuration file. To disable excludes, you can use the ``disable_excludes`` configuration option:

To disable all excludes for e.g. the install command you can use the following combination
of command line options:
``dnf5 --setopt=disable_excludes=* install bash``

``dnf5 --disableexcludes=all --disable-plugin="*" install bash``
For details about the configuration options see :manpage:`dnf5.conf(5)`, :ref:`DNF5 configuration reference <dnf5_conf-label>`.


Modular Filtering
=================
Repository excludes filtering
=============================

Please see `the modularity documentation` for details on how Modular Filtering works.
Similar to global excludes, but this configuration is repository-specific and only affects packages within the repository where the excludes are set.

With modularity, only RPM packages from ``active`` module streams are included in the available
package set. RPM packages from ``inactive`` module streams, as well as non-modular packages with
the same name or provides as a package from an ``active`` module stream, are filtered out. Modular
filtering is not applied to packages added from the command line, installed packages, or packages
from repositories with ``module_hotfixes=true`` in their ``.repo`` file.

Disabling of modular filtering is not recommended, because it could cause the system to get into
a broken state. To disable modular filtering for a particular repository, specify
``module_hotfixes=true`` in the ``.repo`` file or use ``--setopt=<repo_id>.module_hotfixes=true``.
User excludes filtering
=======================

API users have an additional option how to fine-tune excluded packages using ``*_user_excludes()`` and ``*_user_includes`` methods of the ``PackageSack`` object. See :ref:`PackageSack API <api_packagesack-label>`.


Versionlock
===========

Additionally, the versionlock functionality is implemented using excludes filtering. However, these excludes are applied only during transactional operations.
For details see :manpage:`dnf5-versionlock(8)`, :ref:`Versionlock command <versionlock_command_ref-label>`.


Modular filtering
=================

For details on how modular filtering works please see :manpage:`dnf5-modularity(7)`, :ref:`the modularity documentation <modularity_misc_ref-label>`.

To discover the module which contains an excluded package use ``dnf5 module provides``.
With modularity, only RPM packages from ``active`` module streams are included in the available package set. RPM packages from ``inactive`` module streams, as well as non-modular packages with the same name or provides as a package from an ``active`` module stream, are filtered out. Modular filtering is not applied to packages added from the command line, installed packages, or packages from repositories with ``module_hotfixes=true`` in their ``.repo`` file.

Disabling of modular filtering is not recommended, because it could cause the system to get into a broken state. To disable modular filtering for a particular repository, specify
``module_hotfixes=true`` in the ``.repo`` file or use ``--setopt=<repo_id>.module_hotfixes=true``.

Examples
========
..
# TODO(mblaha) - `dnf5 module provides` command is not implemented yet
# To discover the module which contains an excluded package use ``dnf5 module provides``.
9 changes: 2 additions & 7 deletions doc/misc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,8 @@ Miscellaneous
aliases.7
caching.7
comps.7
filtering.7
forcearch.7
installroot.7
specs.7

..
# TODO(jkolarik): Filtering is not ready yet
filtering.7

# TODO(jkolarik): Modularity is not ready yet
modularity.7
specs.7
10 changes: 5 additions & 5 deletions doc/misc/modularity.7.rst
Original file line number Diff line number Diff line change
Expand Up @@ -104,25 +104,25 @@ Non-modular RPMs must remain unavailable and must never get on the system.

This happens when:

* user disables a repository via ``--disablerepo`` or uses ``--repoid``
* user disables a repository via ``--disable-repo`` or uses ``--repo``
* user removes a .repo file from disk
* repository is not available and has ``skip_if_unavailable=true``

DNF keeps copies of the latest modulemd for every active stream
DNF5 keeps copies of the latest modulemd for every active stream
and uses them if there's no modulemd available for the stream.
This keeps package filtering working correctly.

The copies are made any time a transaction is resolved and started.
That includes RPM transactions as well as any ``dnf module <enable|disable|reset>`` operations.
That includes RPM transactions as well as any ``dnf5 module <enable|disable|reset>`` operations.

When the fail-safe data is used, dnf show such modules as part of @modulefailsafe repository.
When the fail-safe data is used, DNF5 show such modules as part of @modulefailsafe repository.


Orphaned modular packages
=========================

All packages that are built as a part of a module have ``%{modularitylabel}`` RPM header set.
If such package becomes part of RPM transaction and cannot be associated with any available
modulemd, DNF prevents from getting it on the system (package is available, but cannot be
modulemd, DNF5 prevents from getting it on the system (package is available, but cannot be
installed, upgraded, etc.). Packages from Hotfix repositories or Commandline repository are not
affected by Fail-safe mechanisms.
Loading