Skip to content

Commit

Permalink
DNF5 should not deprecate DNF on Fedora38
Browse files Browse the repository at this point in the history
Move command provides to python3-dnf

In fedora distribution there are two packages that depends on those
provides therefor the movement of those provide to real provider should
help with transition to dnf5 or at least it allows to use the old dnf4
after obsolete of dnf package.
  • Loading branch information
j-mracek authored and jan-kolarik committed May 26, 2023
1 parent 74491af commit 4548e6a
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 25 deletions.
61 changes: 37 additions & 24 deletions dnf.spec
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
It supports RPMs, modules and comps groups & environments.

Name: dnf
Version: 4.16.0
Version: 4.16.1
Release: 1%{?dist}
Summary: %{pkg_summary}
# For a breakdown of the licensing, see PACKAGE-LICENSING
Expand All @@ -86,29 +86,6 @@ Requires: %{_bindir}/sqlite3
%else
Recommends: (python3-dbus if NetworkManager)
%endif
Provides: dnf-command(alias)
Provides: dnf-command(autoremove)
Provides: dnf-command(check-update)
Provides: dnf-command(clean)
Provides: dnf-command(distro-sync)
Provides: dnf-command(downgrade)
Provides: dnf-command(group)
Provides: dnf-command(history)
Provides: dnf-command(info)
Provides: dnf-command(install)
Provides: dnf-command(list)
Provides: dnf-command(makecache)
Provides: dnf-command(mark)
Provides: dnf-command(provides)
Provides: dnf-command(reinstall)
Provides: dnf-command(remove)
Provides: dnf-command(repolist)
Provides: dnf-command(repoquery)
Provides: dnf-command(repository-packages)
Provides: dnf-command(search)
Provides: dnf-command(updateinfo)
Provides: dnf-command(upgrade)
Provides: dnf-command(upgrade-to)
Conflicts: python3-dnf-plugins-core < %{conflicts_dnf_plugins_core_version}
Conflicts: python3-dnf-plugins-extras-common < %{conflicts_dnf_plugins_extras_version}

Expand All @@ -118,7 +95,9 @@ Conflicts: python3-dnf-plugins-extras-common < %{conflicts_dnf_plugins_extr
%package data
Summary: Common data and configuration files for DNF
Requires: libreport-filesystem
%if 0%{?fedora} > 38
Requires: libdnf5
%endif
Obsoletes: %{name}-conf <= %{version}-%{release}
Provides: %{name}-conf = %{version}-%{release}

Expand Down Expand Up @@ -168,6 +147,29 @@ Requires: rpm-plugin-systemd-inhibit
%else
Recommends: (rpm-plugin-systemd-inhibit if systemd)
%endif
Provides: dnf-command(alias)
Provides: dnf-command(autoremove)
Provides: dnf-command(check-update)
Provides: dnf-command(clean)
Provides: dnf-command(distro-sync)
Provides: dnf-command(downgrade)
Provides: dnf-command(group)
Provides: dnf-command(history)
Provides: dnf-command(info)
Provides: dnf-command(install)
Provides: dnf-command(list)
Provides: dnf-command(makecache)
Provides: dnf-command(mark)
Provides: dnf-command(provides)
Provides: dnf-command(reinstall)
Provides: dnf-command(remove)
Provides: dnf-command(repolist)
Provides: dnf-command(repoquery)
Provides: dnf-command(repository-packages)
Provides: dnf-command(search)
Provides: dnf-command(updateinfo)
Provides: dnf-command(upgrade)
Provides: dnf-command(upgrade-to)

%description -n python3-%{name}
Python 3 interface to DNF.
Expand Down Expand Up @@ -232,6 +234,9 @@ ln -sr %{buildroot}%{confdir}/protected.d %{buildroot}%{_sysconfdir}/yum/protec
ln -sr %{buildroot}%{confdir}/vars %{buildroot}%{_sysconfdir}/yum/vars
%endif

%if 0%{?fedora} > 38
rm %{buildroot}%{confdir}/%{name}.conf
%endif

%check

Expand Down Expand Up @@ -284,8 +289,16 @@ popd
%dir %{confdir}/modules.d
%dir %{confdir}/modules.defaults.d
%dir %{pluginconfpath}
%if 0%{?fedora} <= 38
%dir %{confdir}/protected.d
%dir %{confdir}/vars
%endif
%dir %{confdir}/aliases.d
%exclude %{confdir}/aliases.d/zypper.conf
%if 0%{?fedora} <= 38
%config(noreplace) %{confdir}/%{name}.conf
%endif

# No longer using `noreplace` here. Older versions of DNF 4 marked `dnf` as a
# protected package, but since Fedora 39, DNF needs to be able to update itself
# to DNF 5, so we need to replace the old /etc/dnf/protected.d/dnf.conf.
Expand Down
2 changes: 1 addition & 1 deletion etc/dnf/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
INSTALL (FILES "dnf-strict.conf" "automatic.conf" DESTINATION ${SYSCONFDIR}/dnf)
INSTALL (FILES "dnf-strict.conf" "dnf.conf" "automatic.conf" DESTINATION ${SYSCONFDIR}/dnf)
ADD_SUBDIRECTORY (aliases.d)
ADD_SUBDIRECTORY (protected.d)

0 comments on commit 4548e6a

Please sign in to comment.